Файловый менеджер - Редактировать - /home/umudio/public_html/repo/uploadpiccon.php.tar
Назад
home/umudio/public_html/OLD/uploadpiccon.php 0000644 00000014427 14773625624 0015137 0 ustar 00 <?php if(isset($_POST['editcontentpic'])){ $path="img/temp"; $final="img"; $photo=""; $newfilename=1; $handle=@opendir($final); if(!empty($handle)){ while(false!==($file=readdir($handle))){ if(is_file($final . "/" . $file)){ $newfilename++; } } } //closedir($handle); $snn=$_POST['sn']; include('SimpleImage.php'); $image = new SimpleImage(); //First Picture $input_name="uploader1"; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $maxfilesize=30720000; if($_FILES[$input_name]["size"]>$maxfilesize){ $bb=$bb . " <br>Your picture1 is too large, it cannot be uploaded! It should be below 300kb. "; } else { $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="img/g" . $newfilename . ".jpg"; $photol="limg/g" . $newfilename . ".jpg"; $image->load($photo); $image->resizeToHeight(550); $image->save($photol); $image->load($photo); $image->resizeToHeight(120); $image->save($photo); $photo="img/g" . $newfilename . ".jpg"; $sql="insert into contentphotos (photo, whose) VALUES ('$photo', '$snn')"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo1 Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo1: " . mysql_error() . "</p>"; } } } } } $newfilename++; //Second Picture $input_name="uploader2"; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $maxfilesize=30720000; if($_FILES[$input_name]["size"]>$maxfilesize){ $bb=$bb . " <br>Your picture2 is too large, it cannot be uploaded! It should be below 300kb. "; } else { $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="img/g" . $newfilename . ".jpg"; $photol="limg/g" . $newfilename . ".jpg"; $image->load($photo); $image->resizeToHeight(550); $image->save($photol); $image->load($photo); $image->resizeToHeight(120); $image->save($photo); $photo="img/g" . $newfilename . ".jpg"; $sql="insert into contentphotos (photo, whose) VALUES ('$photo', '$snn')"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo2 Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo2: " . mysql_error() . "</p>"; } } } } } $newfilename++; //Third Picture $input_name="uploader3"; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $maxfilesize=30720000; if($_FILES[$input_name]["size"]>$maxfilesize){ $bb=$bb . " <br>Your picture3 is too large, it cannot be uploaded! It should be below 300kb. "; } else { $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="img/g" . $newfilename . ".jpg"; $photol="limg/g" . $newfilename . ".jpg"; $image->load($photo); $image->resizeToHeight(550); $image->save($photol); $image->load($photo); $image->resizeToHeight(120); $image->save($photo); $photo="img/g" . $newfilename . ".jpg"; $sql="insert into contentphotos (photo, whose) VALUES ('$photo', '$snn')"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo3 Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo3: " . mysql_error() . "</p>"; } } } } } $newfilename++; //Fourth Picture $input_name="uploader4"; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $maxfilesize=30720000; if($_FILES[$input_name]["size"]>$maxfilesize){ $bb=$bb . " <br>Your picture4 is too large, it cannot be uploaded! It should be below 300kb. "; } else { $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="img/g" . $newfilename . ".jpg"; $photol="limg/g" . $newfilename . ".jpg"; $image->load($photo); $image->resizeToHeight(550); $image->save($photol); $image->load($photo); $image->resizeToHeight(120); $image->save($photo); $photo="img/g" . $newfilename . ".jpg"; $sql="insert into contentphotos (photo, whose) VALUES ('$photo', '$snn')"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo4 Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo4: " . mysql_error() . "</p>"; } } } } } $newfilename++; //Fifth Picture $input_name="uploader5"; if(isset($_FILES)){ if(is_uploaded_file($_FILES[$input_name]["tmp_name"])){ $maxfilesize=30720000; if($_FILES[$input_name]["size"]>$maxfilesize){ $bb=$bb . " <br>Your picture5 is too large, it cannot be uploaded! It should be below 300kb. "; } else { $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="img/g" . $newfilename . ".jpg"; $photol="limg/g" . $newfilename . ".jpg"; $image->load($photo); $image->resizeToHeight(550); $image->save($photol); $image->load($photo); $image->resizeToHeight(120); $image->save($photo); $photo="img/g" . $newfilename . ".jpg"; $sql="insert into contentphotos (photo, whose) VALUES ('$photo', '$snn')"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo5 Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo5: " . mysql_error() . "</p>"; } } } } } } ?>