Re: problem with Header("Location: home.php");

From: Date: Thu, 09 Sep 2004 11:51:05 +0000
Subject: Re: problem with Header("Location: home.php");
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-196206@lists.php.net to get a copy of this message
> the following error occuring in above line. > Warning: Cannot modify header information - headers already sent by > (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) > in E:\PHPMySql scripts\bugtrack\index.php on line 117 Have you got any space before you output anything to the browser? I've found that often I've saved a file with a newline at the end by accident - meaning that PHP thinks I'm ready to start sending output and therefore any functions that modify the headers won't work because they've already been sent. Check connection.php around line 3 to see if there is anything sending output before you call session_* or Header(). BTW, you shouldn't use relative URIs in Location: headers, try using: header('Location: http://www.mydomain.com/path/to/home.php'); instead (this won't fix anything, but it's the correct way to do it according to the HTTP/1.1 standard). Hope this helps, Paul

« previous php.general (#196206) next »