Always when I upload a file the result is empty. The code is from here.
The index.html file:
<html>
<body>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
The upload_file.php:
<?php
echo "Upload: " . $_FILES['file']['name'] . "<br>";
?>
The result is:
Upload:
I configure my php.ini, too enable file_upload, memory 5000M, and tmp location.
I don't know it maters but I use Ubuntu.
The result of phpinfo is as I configure.
What's wrong? Thanks!
print_r is show Array ()
echo $_FILES['userfile']['error'];
HP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/msql.so' - /usr/lib/php5/20090626+lfs/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Mar 05 17:48:16 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Wed Mar 05 17:50:05 2014] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Wed Mar 05 17:50:05 2014] [error] [client 127.0.0.1] File does not exist: /var/www/404.html
[Wed Mar 05 17:55:32 2014] [error] [client 127.0.0.1] PHP Notice: Undefined index: file in /var/www/uploadart.php on line 2, referer: http://localhost/index.php
At my original file error log is empty.
print_r($_FILES);like @OneOfOne suggested.move_uploaded_file()<= do read the manual. @user3369031 - Amongst other things. That single line of code won't upload anything. If it isn't your full code, then do post it.