So the code says in the browser that it works, but the file itself is not actually showing up on my server. You can try out the code here: northside.mcsdga.net/reveille/staffsubmit.php I've checked the folder name, and it is correct.
Ok, so I implemented the code to check my move, and I keep getting the error code showing that it's not successfully moving it. Any idea why? Ask me for specs if you need them.
Chances are its a permission issue.
Replace the "Error" with a print_r(error_get_last());. One of the offsets will be message, and I'm betting its either going to be a non-existent directory, or a privilege problem (permission denied).
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Chances are its a permission issue.
Replace the "Error" with a print_r(error_get_last());. One of the offsets will be message, and I'm betting its either going to be a non-existent directory, or a privilege problem (permission denied).
Ok, so I replace the "Error" with the code . . . nothing shows up in the browser. What should I do if it is a permissions problem?
The absolute easiest thing you can do is use mkdir from PHP. That automatically assigns proper ownership. Otherwise, you may need to login through your webhost and chmod the directory manually using SSH.
If you are getting a white page, that indicates a fatal error, assuming that there is supposed to be some kind of output. Enable your error reporting by putting this at the top of the page:
If the only thing that has changed was the addition of error_get_last, then the error will be a non-existent function. Error_get_last is only post 5.2. To get around that, you would instead track errors with:
PHP Code:
ini_set('track_errors', 1); // Somewhere usually at the top
... echo $php_errormsg; // After your attempt to move the uploaded file
Chances are your error reporting is too low. As soon as you open it up to E_ALL, then you will likely see the error without needing to use error_get_last or $php_errormsg.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php