| | |
include(); problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2005
Posts: 92
Reputation:
Solved Threads: 0
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.
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.
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.
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.
![]() |
Similar Threads
- Simple include() problem (PHP)
- How to make these three files pass compiled? (C++)
- Help with calculating avrg from input file. (C++)
- internet explorer opens at 10:51 (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: phpBB to php-nuke integration help
- Next Thread: Hello Dani Web members
Views: 1462 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube





