php header function problem
with below snippet, in IE am getting cannot find server error, but mail sending are working fine,
after mail sent function, the browser showing the cannot find server, but if refresh with F5 key, than page shows normly,
advise, why this error,
in the page top i used the
<?php session_start();ob_start();ob_end_clean(); ?>
<?php
mail($to, $subject, $message, $headers) or die("mail send failed");
$_SESSION['message'] = "<span class=\"txt-sucess\">Thanks for submitting feedback, We get back you soonly.</span>"; 开发者_C百科
header("Cache-control: private, no-cache");
header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Location:feedback.php");
?>
Try the following:
<?php
ob_start();
session_start();
ob_end_clean(); // why?!
mail($to, $subject, $message, $headers) or die("mail send failed");
$_SESSION['message'] = "<span class=\"txt-sucess\">Thanks for submitting feedback, We get back you soonly.</span>";
header("Cache-control: private, no-cache");
header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Location: http://happylife.in/feedback/feedback.php");
?>
PHP.net recommend that you use an absolute URL in your Header->Location instance. This could be what you need. Have you tried different browsers?
精彩评论