views:

36

answers:

2

im trying to include the header at the top of my pages it gives me a blank screen, when i remove it the php file runs and shows the content:

<?php
    include("header.php");
?>

thanks :))

+3  A: 

There is probably an error in that file. try turning display errors and reporting on:

ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
prodigitalson
+1 beat me to it. :)
casablanca
Escaped my mind, but does this work if `header.php` has a parse error?
BoltClock
thanks, how can i turn on the errors globally, and i fixed the problem. thanks
getaway
@boltclock: as long as he does it before the include statement i think so... but im not 100% on that.
prodigitalson
@getaway in your php.ini file, but you might not want to do that if the site is "live"
hookedonwinter
@getaway: Heed hookedonwinter's warning.
prodigitalson
im just testing it, im on a dedciated server, i cnt seem to find my php.ini file, im using plesk.
getaway
`php --ini` from the shell will give you the location of the CLI ini file. normally they will both be in the directory unless youve set CLI up to use one in your `$HOME`. convention generally puts them in `/etc`.
prodigitalson
A: 

Since you're using "include" and not "require", the white screen means you have an error in header.php itself. Use error reporting to narrow the issue down and fix the root of the problem.

Kita