图片上传在本地成功。但在托管后,它无法正常工作。
$imgname=$_FILES["imgfile"]["name"];
if($imgname!=''){
if ((($_FILES["imgfile"]["type"] == "image/jpeg")
|| ($_FILES["imgfile"]["type"] == "image/jpg"))
&& ($_FILES["imgfile"]["size"] < 200000))
{
list($img)=explode("@",$mail); $img=$img.".jpg";
$extension=end(explode(".", $_FILES["imgfile"]["name"]));
move_uploaded_file($_FILES["imgfile"]["tmp_name"],"dpstaff/".$img);
} else { ?> <script type="text/javascript"> alert(" Type mismatch or Exceed Size "); window.location = "reg2.php"; </script> <?php }
} else { ?> <script type="text/javascript"> alert(" No Image Selected "); window.location = "reg2.php"; </script> <?php }
header("location:staf2.php");
}
else
{ ?>
<script type="text/javascript">
alert("Exist same value (mobile no.)");
</script>
<?php
}
和html代码是:
<form method="post" action="staf1.php" enctype="multipart/form-data" >
<tr>
<td> Photo </td>
<td> <input type="file" name="imgfile" id="imgfile" <?php if(!(isset($_GET["edit"]))) echo "required"; ?> />
<mandatory>( < 200KB , jpg format) </mandatory></td>
</tr>
</form>
还有一个问题,信息没有显示。