|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-23 12:06 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 02:00:01 2025 UTC |
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