Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't include header 1

Status
Not open for further replies.

jloffredo

Technical User
Feb 24, 2002
17
US
I have a header.php file one level above the script. When I try to include it the script runs fine and includes in the same directory are included but the header is not included. Any help would be appreciated.

Here is the code I'm using:

<?php
include '../header.php';
?>

Thanks
 
What evidence do you have that the included script is not being included? Any error messages?

What does header.php look like?



Want the best answers? Ask the best questions! TANSTAAFL!
 
There is no code in the header, just the text "test header".

When I move the header to the same location as the script and modify the include statement as such it works fine.

<?php
include 'header.php';
?>

 
This file will not include from the higher directory, but other files will.

What happens when you change:

include '../header.php';

to

require '../header.php';

?



Want the best answers? Ask the best questions! TANSTAAFL!
 
problem solved, the problem was with my server configurtion, not the script.

Thank for your help!
 
I'm ashamed to admit that there was a typo in the name of the file on level up...sorry for waisting your time.
 
You should have gotten some kind of error from PHP, though. What are your php.ini values for "display_errors" and "error_reporting"? It sounds to me like these values are not right for a development environment.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top