Jump to content

Questions?


regoch

Recommended Posts

1. How big pdf file can be uploaded to hosting? I work on page for news company, and they won.t to upload via cms actual number of news. Is it posible via cms or must be via ftp. I got this script for upload pdf that working fine.

      <form action="" method="post" name="fileForm" id="fileForm" enctype="multipart/form-data">
        <center>
        <table>
	  <tr><td style="width:150px;">Naziv PDF-a HR: </td><td><input name="pdf_ime_hr" type="text" class="textfield" id="pdf_ime_hr" /></td></tr>
          <tr><td style="width:150px;">Naziv PDF-a EN: </td><td><input name="pdf_ime_en" type="text" class="textfield" id="pdf_ime_en" /></td></tr>
          <tr><td style="width:150px;">Odaberi pdf za upload:</td><td><input name="upfile" type="file" size="36"></td></tr>
          <tr><td style="width:150px;"></td><td align="lef"><br/><input type="submit" name="Submit" id="Submit" value="Pošalji" /></td></tr>
        </table></center>  
      </form>
<?php
$novost_id = $_GET['novost_id'];   
if (isset($_POST['Submit'])){
$pdf_ime_hr = $_POST['pdf_ime_hr'];
if ($pdf_ime_hr == '') {
	echo "Niste upisali naziv PDF-a";
}
else
{

?>
      <div id="result">
        <table width="100%">
<?php
   function getExtension($str)
      {
         $i = strrpos($str,".");
           if (!$i) { return ""; }       
         $l = strlen($str) - $i;         
         $ext = substr($str,$i+1,$l);         
         return $ext;
      }
$pdf_naziv = stripslashes($_FILES['upfile']['name']);
$extension = getExtension($pdf_naziv);
$extension = strtolower($extension);
$ran_name = rand () ;
$pdf_naziv = 'kus'.$ran_name.'.'.$extension;  
$allowed = array('pdf');
$uploadLocation = "../pdf/$pdf_naziv";
if(in_array($extension, $allowed))
{
if(move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadLocation)) {
$pdf_ime_hr = $_POST['pdf_ime_hr']; 
$pdf_ime_en = $_POST['pdf_ime_en']; 
    echo " <table width='400px' align='center' cellspacing='0'>
<tr bgcolor='#E6e6e6' height='26'>
	<td align='center' width='100%' colspan='2'><strong>Potvrda</strong></td>
</tr>
<tr bgcolor='#F6f6f6'>
    <td align='center' style='border-left:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><img src='images/valid.png'></td>
<td align='center' width='80'% style='border-right:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><strong>".$pdf_naziv." uspješno unesen.</strong></td>
</tr>
</table><br />";
mysql_query("INSERT INTO pdf SET pdf_naziv='$pdf_naziv', pdf_ime_hr='$pdf_ime_hr', pdf_ime_en='$pdf_ime_en', pdf_novost='$novost_id'");
} else{
    echo " <table width='400px' align='center' cellspacing='0'>
<tr bgcolor='#E6e6e6' height='26'>
	<td align='center' width='100%' colspan='2'><strong>Potvrda</strong></td>
</tr>
<tr bgcolor='#F6f6f6'>
    <td align='center' style='border-left:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><img src='images/warning.png'></td>
<td align='center' width='80'% style='border-right:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><strong>PDF nije unesen.</strong></td>
</tr>
</table><br />";;
}
}
else
{
echo "Pokušali ste uploadati datoteku koja nije PDF";
}

?>
        </table>
     </div>
<?php 
}           
}
?>

 

2. Is it posible to add on page script that change desktop background. Exapmle i have 3 pictures for wall paper and user choose wich to put as desktop background?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.