#6546 [Com]: Header Problem
| From: | showrun at yahoo dot com | Date: | Sat, 19 Apr 2003 15:14:01 +0000 |
| Subject: | #6546 [Com]: Header Problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37899@lists.php.net to get a copy of this message | ||
ID: 6546
Comment by: showrun at yahoo dot com
Reported By: nymph at innocent dot com
Status: Closed
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.0.0
New Comment:
I have that problem. What is the suggested workaround?
Maybe someone can post it here? What a novel idea!
Previous Comments:
------------------------------------------------------------------------
[2000-09-05 00:27:32] nymph at innocent dot com
When sending a header after including another file (if the other file
does not write anything directly), you will get a header problem even
though no headers were actually sent. The connect.php only connects to
the database. Nothing else.
CODE:
<?
if (include("include/connect.php")) {}
$mysql_connection = mysql_connect($mysql_host,$mysql_user,
$mysql_pass);
$mysql_query = "SELECT * FROM densetsuFiles WHERE Id = '$id'";
$mysql_result = mysql_db_query($db_name, $mysql_query,
$mysql_connection);
$row = mysql_fetch_array($mysql_result);
if ($row) {
header("Location:
http://www.domain.com/data/$row[Type]/$row[FileName]");
end;
} else {
$error = "File Not Found";
}
?>
Warning: Cannot add header information - headers already sent by
(output started at include/connect.php:8) in
/usr/home/a01/html/densetsu/downloads.php on line 9
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=6546&edit=1