Can someone help me to clear what is the exact path that I should put into upload.php, I am so confused.
Basically I have created a folder "photos" inside of www folder, the path that I put is:
"programs file/EasyPHP1-8/www/charlton/photos"
But I got this error message for upload.php:
Notice: Undefined variable: userfile in c:\program files\easyphp1-8\www\charlton\icchurch\upload.php on line 2
Notice: Undefined variable: userfile in c:\program files\easyphp1-8\www\charlton\icchurch\upload.php on line 6
Notice: Undefined variable: userfile_name in c:\program files\easyphp1-8\www\charlton\icchurch\upload.php on line 6
Could not upload image.
In the upload.php page: this is all code that I put below:
<?php
if($userfile=="none")
{
echo"No file specified";
exit;
}
if(move_uploaded_file($userfile,"\\photos\\".$userfile_name)){
echo"Your image has been uploaded.";}
else{ echo"Could not upload image.";}
?>
And I created a html form:
<body>
Basic image upload:<br>
<form action="upload.php" method="post" enctype="multipart/form-data" name="form1">
<input type="file" name="file">
<br>
<input type="submit" name="Submit" value="upload image">
</form>
</body>
I am not sure if I need to make database connected in the upload.php or not necessary?
Thanks alot!
Beckmann


