The upload html page i'm using
<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>
php file code is given below (upload.php)
<?php
$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";
}
?>
i couldn't succeed in this simple upload scipt.Breaking my head for past two days.Kindly help me
It gives me following error
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 used 5.1
IIS version : 5.1
OS : Win Xp
Hope u'll all help me...Thanx