User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,504 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,665 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1205 | Replies: 7
Reply
Join Date: Sep 2007
Posts: 9
Reputation: pbpyrojust is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

php included header file wont input code when on the server

  #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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: Bucharest, RO
Posts: 67
Reputation: johny_d is an unknown quantity at this point 
Rep Power: 2
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

  #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  
Join Date: Sep 2007
Posts: 9
Reputation: pbpyrojust is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

  #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  
Join Date: May 2007
Location: Bucharest, RO
Posts: 67
Reputation: johny_d is an unknown quantity at this point 
Rep Power: 2
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

  #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  
Join Date: Sep 2007
Posts: 9
Reputation: pbpyrojust is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

  #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  
Join Date: May 2007
Location: Bucharest, RO
Posts: 67
Reputation: johny_d is an unknown quantity at this point 
Rep Power: 2
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

  #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  
Join Date: Sep 2007
Posts: 9
Reputation: pbpyrojust is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pbpyrojust pbpyrojust is offline Offline
Newbie Poster

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

  #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  
Join Date: May 2007
Location: Bucharest, RO
Posts: 67
Reputation: johny_d is an unknown quantity at this point 
Rep Power: 2
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

  #8  
Sep 26th, 2007
I'm glad to be of help!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC