Файловый менеджер - Редактировать - /home/umudio/public_html/OLD/uploadpicseveral.php
Назад
<?php if (isset($_POST["addphoto"])) { require_once('Connecter/dataconn.php'); include('SimpleImage.php'); $path="imgs/temp"; $final="imgs"; $category=$_POST['category']; $dater=date('Y-m-d'); for($i=1; $i<=16; $i++){ $q='titler'.$i; $titler=$_POST[$q]; if($titler==''){ $titler=' '; } $input_name="uploader" . $i; $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="imgs/g" . $newfilename . ".jpg"; $image = new SimpleImage(); $image->load($photo); $image->resizeToWidth(750); $image->save($photo); $photo="imgs/g" . $newfilename . ".jpg"; $sphoto="imgs/s" . $newfilename . ".jpg"; $image2 = new SimpleImage(); $image2->load($photo); $image2->resizeToWidth(100); $image2->save($sphoto); $sphoto="imgs/s" . $newfilename . ".jpg"; if($titler!=''){ $sql="insert into photos (titler, photo, thumb, dater, category) VALUES ('$titler', '$photo', '$sphoto', '$dater', $category)"; if (mysql_query($sql)){ $bb=$bb . "<p>Photo Successfully added</p>"; } else { $bb=$bb . "<p>Unable to add photo: " . mysql_error() . "</p>"; } } } } } } echo($bb); echo('<br><br><a href="listphotoseveral.php">Again</a>'); echo('<br><br><a href="dadmin.php">Back Home</a>'); } ?>
| ver. 1.4 |
Github
|
.
| PHP 5.6.40 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка