<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<style type= "Text/css" >
<!--
body,td,th {
font-size:12px;
Color: #FFFFFF;
}
Body {
Background-color: #999;
margin-left:0px;
margin-top:0px;
}
a:link {
Color: #FFFFFF;
}
a:visited {
Color: #FFFFFF;
}
a:active {
Color: #FFFFFF;
}
-->
</style>
<body>
<?php
$dest _folder = "/picture/";
if (!file_exists ($dest _folder)) {
mkdir ($dest _folder);
}
foreach ($_files["Pictures"] ["error"] as $key => $error) {
if ($error = = UPLOAD_ERR_OK) {
$houzhui =substr ($_files["Pictures"] ["name"] [$key],-4);
if ($_files["Pictures"] ["size"] [$key]<=1024*100)//100k
{
if ($houzhui = = ". jpg" or $houzhui = = ". gif")
{
$tmp _name = $_files["Pictures" ["Tmp_name"] [$key];
$name = Date ("Ymdhs"). " _ ". Mt_rand (10000,99999). $houzhui;
$uploadfile = $dest _folder. $name;
Move_uploaded_file ($tmp _name, $uploadfile);
echo "<script>
Parent.img.value= "". $uploadfile. "";
Parent.sm1.disabled=false;
</script>
<div align=center> Map uploaded successfully. [<a href=upload.htm onclick= "parent.sm1.disabled=true;" > re-upload </a>]</div> ";
}
Else
echo "<script>alert (' Sorry, you upload the file format is not correct!) Please upload a picture file in GIF or. jpg format! ' History.go ( -1);</script> ";
}
Else
echo "<script>alert (' Sorry, the file you uploaded is too big!) Please upload the file size less than 100k picture File! '; History.go ( -1);</script> ";
}
}
?>
</body>