为什么通过其他控件调用它的CLICK()功能,看起来是选好了要上传的文件,但实际上不能上传?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~不懂
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~不懂
调试欢乐多
if($up_picture_size>0)
{
$tmp="./mypicture".$photo;
if (!copy($up_picture, $tmp))
{
print("复制文件 $tmp 失败...<br>\n");
}
else
{
unlink($up_picture);
}
}
?>
<html>
<head>
<title>upload picture</title>
<script language="javascript1.2">
function photo_change()
{
var fromidx,filename=document.form1.up_picture.value;
fromidx=filename.lastIndexOf('.');
if(fromidx!=-1)
{
document.form1.photo.value=filename.substring(fromidx,filename.length);
}
else
{
document.form1.up_picture.value='';
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body topmargin="0" leftmargin="0" >
<form name='form1' method="post" ENCTYPE = "multipart/form-data"> <input type="file" name="up_picture" size="10" value='' style=" VISIBILITY: hidden;">
<INPUT TYPE = "hidden" NAME = "MAX_FILE_SIZE" VALUE ="1000000">
<input type="hidden" name="photo" value=''>
<a href='#' onclick="javascript:up_picture.click();photo_change();"> 照 片</a>
<input type="submit" name="save" value="确定" >
<input type="reset" name="cancel" value="取消" >
</form>
</body>
</html>
www.w3.org