Steven
December 19th, 2007, 13:54
OK, here is the error msg I get:
Warning: Cannot modify header information - headers already sent by(...)
This is for an email form that I have on my contact page. Here is part of the code:
(... some PHP & HTML Codes...)
<?php
}
else{
$to_mail = "wajih14@gmail.com";
foreach($_POST as $key => $value){
$_POST[$key] = preg_replace("/BCC:/", "**SPAM ATTEMPT**", $value);
mail( $to_mail, $subject, $message, "From: $name <$email>" );
header( "Location: http://www.lightblu.com/4/success.php" );
}
}
else{
?>
(... some more PHP & HTML Codes...)
I think I know where the problem lies... the header shouldn't be after any HTML codes (I think). Where could I place it then? This is the only logical place that it should be.
Help?
Warning: Cannot modify header information - headers already sent by(...)
This is for an email form that I have on my contact page. Here is part of the code:
(... some PHP & HTML Codes...)
<?php
}
else{
$to_mail = "wajih14@gmail.com";
foreach($_POST as $key => $value){
$_POST[$key] = preg_replace("/BCC:/", "**SPAM ATTEMPT**", $value);
mail( $to_mail, $subject, $message, "From: $name <$email>" );
header( "Location: http://www.lightblu.com/4/success.php" );
}
}
else{
?>
(... some more PHP & HTML Codes...)
I think I know where the problem lies... the header shouldn't be after any HTML codes (I think). Where could I place it then? This is the only logical place that it should be.
Help?