PHP上传脚本问题 [英] problem in php uploading script

查看:66
本文介绍了PHP上传脚本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head> <title> </title></head>
<body> 
<form enctype="multipart/form-data" name="upload" action="upload.php" method="post">
<input  name="file4upload"  type="file"> </input> <br>
<input name="submit" type="button" value="Upload File" > 
</form>
</body>



</html>













$$target_path="upload/";
$target_path=$target_path.basename($_FILES['file4upload']['name']);
if(move_uploaded_file($_FILES['file4upload']['tmp_name'],$target_path))
{
echo " File ".basename($_FILES['file4upload']['name'])."has been uploaded";
}


else
{
echo "Unsuccessful";
}






我得到的错误是






Error i get is

Notice: Undefined index: file4upload in C:\Documents and Settings\All Users\Documents\PHP practice\upload.php on line 3

Notice: Undefined index: file4upload in C:\Documents and Settings\All Users\Documents\PHP practice\upload.php on line 4
Unsuccessful 


php version :5.1
IIs 5.1
OS win xpsp3




请帮助我...我哪里出错了.
谢谢...




kindly help me... and where i go wrong.
Thanx...

推荐答案

target_path = " ;
target_path="upload/";


target_path =
target_path=


target_path.basename(
target_path.basename(


这篇关于PHP上传脚本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆