note 58103 added to function.headers-sent

From: Date: Mon, 24 Oct 2005 13:50:58 +0000
Subject: note 58103 added to function.headers-sent
Groups: php.notes 
Request: Send a blank email to php-notes+get-97516@lists.php.net to get a copy of this message
Hi all , i got the problem with this insert.php file.. where my server web address is http://ahau.twbbs.org/NTUISA_chat1/login.php then after user already login,when user want to type a message. this program got error. the error is show below : Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\NTUISA_chat1\insert.php:8) in C:\Program Files\Apache Group\Apache2\htdocs\NTUISA_chat1\insert.php on line 35 ============================================= the insert.php is show below : <html> <head> <title>Inserimento del messaggio</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? include("config.php"); $nick=$_GET['nick']; $password=$_GET['password']; $messaggio=$_GET['messaggio']; $messaggio=stripslashes($messaggio); $messaggio=str_replace("\n"," ",$messaggio); $commento=$nick."|".$messaggio."\n"; $url="chat.php"."?nick=".$nick."&password=".$password; $cercamsg = strstr($messaggio,"<"); $cercamsg2 = strstr($messaggio,">"); if (empty($messaggio)) { header("Location: $url"); } elseif ($cercamsg & $cercamsg2) { $header("Location: $url"); } else { $apri_file=fopen($file_mess,"a+"); fputs($apri_file,$commento); fclose($apri_file); header("Location: $url"); } ?> </body> </html> THANKS FOr THIs help.. ---- Manual Page -- http://www.php.net/manual/en/function.headers-sent.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58103 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58103&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58103&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#97516) next »