I have a form submission via POST. I submit the form, and all is well, however if I try to reload the new page that the form goes to after submission, I get the "Do you want to resend data" message (FireFox). It might happen in other browsers too, but I'm not sure.
What I have tried:
<?php
if(isset($_POST['submit_ex']))
{
$name = $_POST['nameex'];
$email = $_POST['emailex'];
$mobnum = $_POST['phoneex'];
$typehidden=$_POST['current_url'];
$textmessage =$_POST['messageex'];
$msg = $_POST['msg'];
$to = 'pavan@onemg.co';
// subject
$subject = 'ONEMG Expertise Enquiry';
// message
$message = '
<title>ONEMG Enquiry Details
ONEMG Works Enquiry Details
<!--
-->
<!--
-->
ONEMG Works Enquiry Details
|
Name | : | '.$name.' |
Mobile | : | '.$mobnum.' |
Email Id | : | '.$email.' |
Mobile Number | : | '.$mobnum.' |
Current Enquiry Page | : | '.$typehidden.' |
Message | : | '.$textmessage.' |
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
//$headers .= 'To: Alterego <info@alterego360.in>' . "\r\n";
$headers .= 'From: <'.$email.'>' . "\r\n";
// Mail it
//mail($to, $subject, $message, $headers);
//header("location:portfolio/portfolio.php?page=portfolio");
//header("location:index.php");
//header("location:portfolio.php");
//echo "window.location='http://www.onemindgroup.com/onemg-test/thank-you-expertise.php'";
if(@mail($to, $subject, $message, $headers))
{
echo "window.location='http://www.onemindgroup.com/onemg-test/thank-you-expertise.php'";
}else{
echo "Mail was not sent!";
}
}
?>