Файловый менеджер - Редактировать - /home/umudio/public_html/repo/uploadslide.php.tar
Назад
home/umudio/public_html/OLD/uploadslide.php 0000644 00000002364 14773626020 0014750 0 ustar 00 <?php if(isset($_POST['editslide'])){ $joy=$_POST['sn']; $input_name="uploader"; $path="slide/temp"; $final="slide"; $photo=""; $newfilename=1; $handle=@opendir($final); if(!empty($handle)){ while(false!==($file=readdir($handle))){ if(is_file($final . "/" . $file)){ $newfilename++; } } } //closedir($handle); //global $_FILES; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $file_name=$_FILES[$input_name]["name"]; $ext=(substr($file_name,(strlen($file_name)-3))); $new=$path . "/g" . $newfilename . ".jpg"; if ($ext=="jpg" || $ext=="JPG" || $ext=="peg" || $ext=="PEG"){ move_uploaded_file($_FILES[$input_name]["tmp_name"],$path . "/" . $file_name); rename ($path . "/" . $file_name, $new); copy ($new, $final . "/g" . $newfilename . ".jpg"); unlink ($new); $photo="slide/g" . $newfilename . ".jpg"; include('SimpleImage.php'); $image = new SimpleImage(); $image->load($photo); $image->resizeToHeight(300); $image->save($photo); $photo="slide/g" . $newfilename . ".jpg"; $sql="update slidephotos set photo='$photo' where sn=$joy"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo" . $joy . " Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo" . $joy . ": " . mysql_error() . "</p>"; } } } } } ?>