#40208 [NEW]: Cannot modify header information
| From: | jos_php at yahoo dot com | Date: | Tue, 23 Jan 2007 11:57:10 +0000 |
| Subject: | #40208 [NEW]: Cannot modify header information | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-107928@lists.php.net to get a copy of this message | ||
From: jos_php at yahoo dot com
Operating system: linux
PHP version: 4.4.4
PHP Bug Type: *General Issues
Bug description: Cannot modify header information
Description:
------------
when I use header("Location: mailform.php"); function giving error "Cannot
modify header information - headers already"
Reproduce code:
---------------
<body><?php
if (($_REQUEST['FromId'])!="")
{
$FromId = $_REQUEST['FromId'] ;
$ToId = $_REQUEST['ToId'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( $ToId, "Subject: $subject",
$message, "From: $FromId" );
echo "Thank you for using our mail form";
}
else
{
header("Location: mailform.php");
exit;
}?>
</body>
Expected result:
----------------
It suppose to redirect to mailform.php
Actual result:
--------------
Warning: Cannot modify header information - headers already sent by
(output started at
/webcorp1/www/corpusers/a/c/acceptachildtoday.org/sendmail.php:7) in
/webcorp1/www/corpusers/a/c/acceptachildtoday.org/sendmail.php on line 20
--
Edit bug report at http://bugs.php.net/?id=40208&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40208&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40208&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40208&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40208&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40208&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40208&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40208&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40208&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40208&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40208&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40208&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40208&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40208&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40208&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40208&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40208&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40208&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40208&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40208&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40208&r=mysqlcfg