Jump to content

Recommended Posts

Hi, I am very new to programming and have been following the instructions in a book to help familiarize myself with it. I have made 3 pages, a log in, the page after the log in which provides simply a link to click on and the main content page. All three pages work well. I have made it to the section describing includes. I made my simple include page (code below), added a line that reads <?php include "header.php"; ?> right after the <body> tag on the page. As long as that line exist anywhere in the code for the page I get nothing but an empty, white page. When I remove it everything works as it should.

 

Pretty frustrating. if someone could steer me right I would really appreciate it!

Link to comment
https://forums.phpfreaks.com/topic/125299-includes/
Share on other sites

I am guessing that you do not have error reporting turned on in your php.ini configuration file. The include is generating an error but you are not seeing it on screen. The script is terminating at this point. Look for display_errors in your php.ini and set to On. Restart your webserver. You can also add the following line to a php file that is included on all your pages:

 

ini_set('display_errors', 'On');
ini_set('error_reporting', E_ALL & ~E_NOTICE);

 

You should then see why your include is not working. Probably to do with a filepath.

Link to comment
https://forums.phpfreaks.com/topic/125299-includes/#findComment-647686
Share on other sites

Thanks Neil!! Maybe I can utilize that to get it to work on my laptop as well. I have it set up exactly the same on my desktop and laptop and I only get blank pages on the laptop. Anyway, would you believe the problem was an extra quote?? I can't believe I didn't see it!!

 

Thanks again!!

Link to comment
https://forums.phpfreaks.com/topic/125299-includes/#findComment-647754
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.