$path =$_server["document_root"];//server path
$i = 0;
foreach ($_files["Pictures"] ["error"] as $key => $error) {
if ($error = = UPLOAD_ERR_OK) {
$upload _file=$_files[' pictures ' [' tmp_name '] [$key the temporary filename stored in the server after the];//file was uploaded
$imgtype = Strtolower (strrchr ($_files[' pictures '] [' name '] [$key], ".");
$name _1 = Strtolower (substr ($_files["Pictures"] ["name"] [$key],0,2)];
$upload _file_name= "Lanmayi_". Time () $name _1. $imgtype//file name in seconds of Alphabet and system times
$store _dir = $path. " /up_img/";//upload file storage location
$file _size_max = 100000000000;//1M limit file upload maximum capacity (bytes)
$accept _overwrite = 0;//whether to allow overwriting of the same file
Move_uploaded_file ($upload _file, $store _dir. $upload _file_name);
$new _img_name = $upload _file_name;
$new _img_type = substr ($imgtype, 1, 3);
$new _img_path = $store _dir;
$suo _name = Makesuo ($new _img_path, $new _img_name, $new _img_type);
$sh _time = Date (' y-m-d h:i:s ');
$name = $_post[' name '];
$pid = $id;
$sql = "INSERT into Lanmayi_img_show (pid,sh_name,sh_url,sh_suo,sh_time) VALUES (". $pid. ", '". $name [$i]. $upload _ file_name. "', '". $suo _name "', '" "$sh _time." ') ";
$res = Mysqli_query ($conn, $sql);
$i + +;
}
}
* Bulk upload End ********************************************************
?>
<script language= "JavaScript" >
Alert ("Image upload success!") ")
</script>
<?php
}
if ($_post[' Fanhui ']) {
?>
<script language= "JavaScript" >
Window.location= ' pro_list.php?id=<?php echo $id?> ';
</script>
<?php
}
?>