2

I have developed a script but whenever i open admin panel it shows just a blank page, however the same script works fine on my another server. I tried changing chmod of files and folders 644, 755, 775 and 777 but still it outputs a blank page.

The main script works fine but its only admin panel thats not working. I check .htaccess also same on both servers.

Any idea what is wrong?

Thank You.

3 Answers 3

2

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')
Sign up to request clarification or add additional context in comments.

1 Comment

checked all files are present
2

put this at the top of your admin page

ini_set('display_errors',1);
error_reporting(E_ALL);

The servers probably have different things installed which is causing an error that you can see.

2 Comments

sorry there was some silly mistake by me i tried again adding those lines and got this as my 1st error Notice: Undefined index: submit in /var/www/admin/index.php on line 8
the function on line 8 is if($_POST['submit'] == 'Login')
0

This may sound stupid, but seeing as you all you said was it "outputs a blank page", are you sure there's no output at all? Have you checked the page source, just in case? Remember that if your page starts with a bad HTML tag or something similar, there will be output but that doesn't mean anything is actually rendered in the browser.

Also make sure output buffering isn't on... I can't remember if this can cause issues when trying to debug, but who knows?

1 Comment

theres no output <html><head/><body/></html> however when i echo before error line 8 as mentioned in comment of Galen i get echo outputted .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.