Check the error log of your HTTP server (e.g. Apache). In 99% of cases of a blank page, PHP has experienced a fatal error and exited before generating any output.
If this script works on another server, I'd check that the script can find everything it needs to include
or require
. Files not found are common fatal errors when moving a script from one environment to another. For instance, if you deployed the file to the new server without configuring the include_path
correctly.
Re your comment about the notice you got:
Notice: Undefined index: submit in /var/www/admin/index.php on line 8
the function on line 8 is if($_POST['submit'] == 'Login')
This means your $_POST
array does not contain a field 'submit'
. Referencing a non-existant array index in PHP is an E_NOTICE
. You can fix this in the following way:
if (array_key_exists('submit', $_POST) && $_POST['submit'] == 'Login')