Issue
$result = $mail->send($recipient, $headers, $html);
if($result === 1)
{
$report= "1";
header("Location: objednavka.php?reaction=".$report);
//echo("Your message has been sent!");
}
else
{
$report= "2";
header("Location: objednavka.php?reaction=".$report);
//echo("Your message was not sent: " . $result);
}
if this mail function runs down the if statement decide that if it was successfull or not. If I use the echo() part it writes that Your message has been sent. But if I want to redirect the user to another page it doesnt work. Why? How can I call the header function successfully?
Solution
From PHP - header():
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
Answered By - fedorqui Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.