想得到upfile的数据,可以这样做:
在first.html中:
<form name="form1" action="put.php">
<input type=file name=upfile >
<input type="submit" name="bu1">
</form>
在put.php中就可以取得upfile的值:
<?echo $upfile?>
在first.html中:
<form name="form1" action="put.php">
<input type=file name=upfile >
<input type="submit" name="bu1">
</form>
在put.php中就可以取得upfile的值:
<?echo $upfile?>
都有提交上去.
可是到第二页就是得不到upfile这个值.
或
$HTTP_POST_FILES["upfile"]["name"]
if(!is_array($HTTP_POST_FILES['file1']
{
print('<html><body>You didn't upload a file</body></html>');
exit;
}//If we got here, we must've gotten something
$f=&$HTTP_POST_FILES[]file1'];
$dest_dir='upload';
$dest=$dest_dir.'/'.$f['name'];//make sure we can actually put the file where it's supposed to go
if(!is_uploaded_file($f['tmp_name']))
{
print('<html><body>Error:No file upload</body></html>');
exit;
}
if(!file_exists($dest_dir))
{
print('<html><body>Error:Destination directory"'.$dest_dir.'"does not exist!</body></html>');
exit;
}
if(!is_dir($dest_dir))
{
print('<html><body>Error:Destionation directory"'.$dest_dir.'"is not a directory!</body></html>');
exit;
}
if(file_exists($dest))
{
print('<html><body>Error:File"'.$dest.'"already exists!</body></html>');
exit;
}//all clear,move the file to its permanent location
$r=move_uploaded_file($f['tmp_name'],$dest);
if($r==false)
{
print('<html><body>Error:Could not copy file to "'.$dest.'"</body></html>');
esit;
}
enctype="multipart/form-data"加了没有???