想得到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?>
解决方案 »
- php邮件发送,服务器拒接连接
- 想扎扎的从零开始学习PHP+MYSQL,请推荐几本经典的学习资料
- php初学者问题(表单提交,后按刷新)
- PHP调用JAVA的WebService,参数类型是JAVA的MAP
- 请高手帮忙,file("test.php")可以,file("http://xxx.xxx.xxx/test.php")就不行,奇怪了!
- 求美化版天气预报一份
- php中如何判断一个int是奇数还是偶数
- 关于验证码
- 怎么让复选框只读,但是这个值又是需要传递的
- 为什么会这样???
- PHP中如何实现网络的数据流,向REQUEST 写入数据流
- 关于mysql的代化.做500人的压力测试,遇到的问题
都有提交上去.
可是到第二页就是得不到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"加了没有???