I've been trying to upload images with this script, I havent gotten to work properly, could you please take a look at it and tell me what is wrong with it?
the html form
<FORM ACTION="fileupload.php" METHOD=POST ENCTYPE="multipart/form-data">
<P>Select file to upload:<INPUT TYPE=FILE NAME="uploadedfile"></P>
<P><INPUT TYPE=SUBMIT NAME="submit" VALUE="Submit"></P>
</FORM>
the php script
<?
// Pick a file extension
if ("image/pjpeg" == $uploadedfile_type or "image/gif" == $uploadedfile_type)
{
if ( "image/pjpeg" == $uploadedfile_type )
$extension = ".jpg";
else
$extension = ".gif";
// The complete path/filename
$filename = "C:\Uploads\".time().$REMOTE_HOST.$extension;
// Copy the file
if (copy($uploadedfile,$filename)) { echo("<P>File stored successfully as $filename.");}
else { echo("<P>Could not save file as $filename!");}
} else
{ echo("<P>Please submit a JPEG or GIF image file.\n");
}
?>
the error I'm getting
Warning: Unable to open '\php2' for reading: No such file or directory in c:\program files\apache group\apache\htdocs\uploadpics\fileupload.php on line 19
Could not save file as C:\Uploads\994798138.gif!
Have no idea where the path \php2 is comming from, please if you can give me some hints, regards sanddy.