I've Googled my problem but can't fix it (I'm new to PHP), the $_FILES function gives me 'Object not found...', the following is the simple code:
<?php
echo <<<_END
<html><head><title>Upload Test</title></head><body>
<form method='post' action='upload.php' enctype='multipart/form-data'>
Select File: <input type='file' name='filename' />
<input type='submit' value='Upload' />
</form>
_END;
if ($_FILES){
$fname = $_FILES['filename']['name'];
move_uploaded_file($_FILES['filename']['tmp_name'], $fname);
echo "<img src='$fname' />";
}
echo "</body></html>";
?>
When I hover the mouse over a link in the error message, I see that the file name is interpreted as:
http://127.0.0.1:8080/file%2520uploading%2520-%2520CODE%2520PROBLEM%2520ASK%2520!.php
I don't have enough reputation to give a screenshot of the error, so here's the important part of it: "The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated." The words 'referring page' of the error message is a hyperlink that displays the file name mentioned just above (when I hover the mouse over that link).
To me, $fname as destination seems ok, can anyone tell me what is wrong with the code? I've also tried reading an error code but run into more problems that way, so I'm keeping the code simple.
Supporting details:
I'm testing the code on my laptop (Windows 7) which has my WAMP installation (from EasyPHP)
Thanks very much in advance.