944,181 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2457
  • PHP RSS
Sep 23rd, 2007
0

php included header file wont input code when on the server

Expand Post »
I am using <?php include ('/php/header.php'); ?> in my php index file. Everything shows up in Dreamweaver, but as soon as it hits the web server and I go to access it absolutely nothing shows up. All I get is a blank page with no source code. HELP!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pbpyrojust is offline Offline
12 posts
since Sep 2007
Sep 23rd, 2007
0

Re: php included header file wont input code when on the server

You pobably have a sintax (writing) error in your 'header.php' file; check that you have closed all the brackets and parenthesis and also that you have sthe ';" at the end of every line of code etc.
Yu also might have a wrong path to the file: '/php/header.php' means the php folder under your root directory; my guess is that you have an error in your header.php file, but on your local system the path to your file is wrong and php passes over the file (try to use require instead of include and see if you get an error) while on your server, the path is ok, causing the main script to really load the header.php (with the error in it) which gives you tha blank page... or the vice-versa: the local path is ok but the remote path is wrong; check that everything is right both local and remote.
Than, of course, I may be wrong
Last edited by johny_d; Sep 23rd, 2007 at 5:08 pm.
Reputation Points: 33
Solved Threads: 7
Junior Poster in Training
johny_d is offline Offline
92 posts
since May 2007
Sep 23rd, 2007
0

Re: php included header file wont input code when on the server

Now I am getting this error

Fatal error: main() [function.require]: Failed opening required '/php/header.php' (include_path='.:/usr/local/lib/php') in /homepages/22/d205045794/htdocs/temple_games/index2.php on line 4
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pbpyrojust is offline Offline
12 posts
since Sep 2007
Sep 23rd, 2007
0

Re: php included header file wont input code when on the server

That's exactly what I said: the path to the file is wrong.
Try to use a relative path, instead of an absolute path and make sure it is correct.
Reputation Points: 33
Solved Threads: 7
Junior Poster in Training
johny_d is offline Offline
92 posts
since May 2007
Sep 24th, 2007
0

Re: php included header file wont input code when on the server

Click to Expand / Collapse  Quote originally posted by johny_d ...
That's exactly what I said: the path to the file is wrong.
Try to use a relative path, instead of an absolute path and make sure it is correct.
Path to the header file or to the php folder?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pbpyrojust is offline Offline
12 posts
since Sep 2007
Sep 24th, 2007
0

Re: php included header file wont input code when on the server

to the header file;
if you don't know exactly what the path is, wright here the path to both your 'header.php' file and the main file (the one that tries to include the header), starting from the root of your server; for instance, if your header.php is in 'www.yourdomain.com/php/header.php' the absolute path (starting from the root of your server) is '/php/header.php'
Reputation Points: 33
Solved Threads: 7
Junior Poster in Training
johny_d is offline Offline
92 posts
since May 2007
Sep 25th, 2007
0

Re: php included header file wont input code when on the server

Click to Expand / Collapse  Quote originally posted by johny_d ...
to the header file;
if you don't know exactly what the path is, wright here the path to both your 'header.php' file and the main file (the one that tries to include the header), starting from the root of your server; for instance, if your header.php is in 'www.yourdomain.com/php/header.php' the absolute path (starting from the root of your server) is '/php/header.php'
Some times it's the little things that always stump me. Glad to have people like you around. Thanks!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pbpyrojust is offline Offline
12 posts
since Sep 2007
Sep 26th, 2007
0

Re: php included header file wont input code when on the server

I'm glad to be of help!
Reputation Points: 33
Solved Threads: 7
Junior Poster in Training
johny_d is offline Offline
92 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP vs Cold Fusion
Next Thread in PHP Forum Timeline: Need Help On SSL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC