php included header file wont input code when on the server

Reply

Join Date: Sep 2007
Posts: 12
Reputation: pbpyrojust is an unknown quantity at this point 
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

php included header file wont input code when on the server

 
0
  #1
Sep 23rd, 2007
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!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 68
Reputation: johny_d is an unknown quantity at this point 
Solved Threads: 4
johny_d's Avatar
johny_d johny_d is offline Offline
Junior Poster in Training

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

 
0
  #2
Sep 23rd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: pbpyrojust is an unknown quantity at this point 
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

 
0
  #3
Sep 23rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 68
Reputation: johny_d is an unknown quantity at this point 
Solved Threads: 4
johny_d's Avatar
johny_d johny_d is offline Offline
Junior Poster in Training

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

 
0
  #4
Sep 23rd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: pbpyrojust is an unknown quantity at this point 
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

 
0
  #5
Sep 24th, 2007
Originally Posted by johny_d View Post
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?
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 68
Reputation: johny_d is an unknown quantity at this point 
Solved Threads: 4
johny_d's Avatar
johny_d johny_d is offline Offline
Junior Poster in Training

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

 
0
  #6
Sep 24th, 2007
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'
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: pbpyrojust is an unknown quantity at this point 
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

 
0
  #7
Sep 25th, 2007
Originally Posted by johny_d View Post
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!!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 68
Reputation: johny_d is an unknown quantity at this point 
Solved Threads: 4
johny_d's Avatar
johny_d johny_d is offline Offline
Junior Poster in Training

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

 
0
  #8
Sep 26th, 2007
I'm glad to be of help!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC