944,030 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1627
  • PHP RSS
Jun 9th, 2005
0

include(); problem

Expand Post »
Hi,
I have a file with the dbase connection details which I call into my script using: include("config.php");

Problem is that when I need to include a page redirection, namely:
header("Location: other_page.php");

I get an error saying that headers were already sent from the line with the include("config.php");

How do i get around this so I don't have to write out the dbase connections everytime I need to have a
header("Location: other_page.php");
thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
michael123 is offline Offline
93 posts
since Jun 2005
Jun 9th, 2005
0

Re: include(); problem

I assume you already checked to make sure config.php does not actually echo or print anything to the buffer!

Look at your closing ?>. Is there a blank line after it? I've seen this cause the problem you describe. Delete anything after the closing tag. Also, if you are using PHP on Linux, make sure your files use Linux style line endings.
Reputation Points: 36
Solved Threads: 6
Posting Whiz
Troy is offline Offline
354 posts
since Jun 2005
Jun 10th, 2005
0

Re: include(); problem

Thanks, Troy.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
michael123 is offline Offline
93 posts
since Jun 2005

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: phpBB to php-nuke integration help
Next Thread in PHP Forum Timeline: Hello Dani Web members





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


Follow us on Twitter


© 2011 DaniWeb® LLC