RE: chat script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx] 
Sent: Sunday, April 17, 2005 8:46 AM
To: php-general@xxxxxxxxxxxxx
Subject:  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

   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux