RE: [PHP] chat script

From: Date: Sun, 17 Apr 2005 08:27:27 +0000
Subject: RE: [PHP] chat script
Groups: php.general 
Request: Send a blank email to php-general+get-213229@lists.php.net to get a copy of this message
This error message is because you are trying to send header information after you already printed some text. The header information have to come before any other information sent to the browser meaning : <?php Print ("hello"); header('Location: http://www.example.com/'); ?> WON'T WORK!!! But <?php header('Location: http://www.example.com/'); print ("hello"); ?> Will work And another ting the <?php should be in the first line of the php file even an empty line will generate the error!. Line 1=> Line 2=><?php Line 3=> header('Location: http://www.example.com/'); . . . WON'T WORK!! And you can use headers_sent() to check if you can send the header information if (!headers_sent()) { header('Location: http://www.example.com/'); exit; } Have a nice day Yaron Khazai -----Original Message----- From: sukalyan banga [mailto:sukalyanb@rediffmail.com] Sent: Sunday, April 17, 2005 8:46 AM To: php-general@lists.php.net Subject: [PHP] chat script  Sir, I am hosted a chat script at www.bioraj.net/raj/chat/ but it shows some error what should I do. sukalyan

« previous php.general (#213229) next »