rendered paste body<?############################################# ## DO NOT EDIT THIS LINE: # if($MAX_FILE_SIZE == 1000000) upload(); ## ## ## THIS SCRIPT ARE WORKING CORRECT WHEN ## CURRENT FOLDER ARE CLOSED BY htaccess ## #############################################?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head> <title>Password Request</title></head><body><center><br><font face="Verdana" size="2"><b>Please, submit examples of pictures:</b><form ENCTYPE="multipart/form-data" action='<?=$PHP_SELF;?>' method ='POST'><INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000"><!-- max size -->Image #1 <INPUT NAME="userfile[]" TYPE="file" size="50"><br>Image #2 <INPUT NAME="userfile[]" TYPE="file" size="50"><br>Image #3 <INPUT NAME="userfile[]" TYPE="file" size="50"><br><!-- end upload image to server --><br><input type = 'submit' value = ' Send '></form></font></center></body></html><?function upload(){ require "admin.ini.php"; require $path_full."define.php"; global $userfile, $REMOTE_USER, $PHP_AUTH_PW, $MAX_FILE_SIZE; $pismo = ''; $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; $url_array = pathinfo($_SERVER["PHP_SELF"]); $pre_url = str_replace($url_array[basename], "", $url); $array = array(); $dir = opendir("samples"); while($s = readdir($dir)) if($s != '.' && $s!= '..') array_push($array, intval($s, 'integer')); if(count($array) > 0){ sort($array); $last_file_name = end($array); } else $last_file_name = 0; for($i = 0; $i < count($userfile); $i ++) if(!empty($userfile[$i])) { $last_file_name ++; if(!file_exists("samples/$last_file_name")) { if(file_exists($userfile[$i])) { if(filesize($userfile[$i]) > $MAX_FILE_SIZE) die ("ERROR: The size of a picture is more than allowable (950Kb)"); $spisok = GetImageSize($userfile[$i]); if($spisok[2] == 1 && copy($userfile[$i], "samples/".$last_file_name.".gif")){ $pismo .= $pre_url."samples/".$last_file_name.".gif\n"; echo "File was uploaded $last_file_name.gif<br>"; } elseif($spisok[2] == 2 && copy($userfile[$i], "samples/".$last_file_name.".jpg")){ $pismo .= $pre_url."samples/".$last_file_name.".jpg\n"; echo "File was uploaded $last_file_name.jpg<br>"; } else "Can't upload $userfile_name. Be sure that file format is jpg or gif."; unlink($userfile[$i]); } } else {echo "<font color=\"Red\">Error file $userfile_name exist!</font><br>";} }//END if(!empty($file)) if(strlen($pismo) > 0 && $REMOTE_USER != '' && $PHP_AUTH_PW != ''){ $pismo .= "\n\nValidate: ".ADMIN_URL."validate.php?login=".$REMOTE_USER."&pass=".md5($PHP_AUTH_PW); $headers = "From: \nReply-To: \nContent-Type: text/plain; charset=windows-1251\nContent-Transfer-Encoding: 8bit"; @mail(WMEMAIL, "Submit request: ".$_SERVER["HTTP_HOST"], $pismo, $headers); } exit;}?>