php - $_FILES gives Object Not Found (html code is complete) -
i've googled problem can't fix (i'm new php), $_files function gives me 'object not found...', following 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 hover mouse on link in error message, see file name interpreted as:
http://127.0.0.1:8080/file%2520uploading%2520-%2520code%2520problem%2520ask%2520!.php i don't have enough reputation give screenshot of error, here's important part of it: "the requested url not found on server. link on referring page seems wrong or outdated." words 'referring page' of error message hyperlink displays file name mentioned above (when hover mouse on link).
to me, $fname destination seems ok, can tell me wrong code? i've tried reading error code run more problems way, i'm keeping code simple.
supporting details:
i'm testing code on laptop (windows 7) has wamp installation (from easyphp)
thanks in advance.
see link..http://www.w3schools.com/php/php_file_upload.asp.. show image uploading helpfully...
Comments
Post a Comment