PHP-POWER Posted May 15, 2007 Share Posted May 15, 2007 Hi am new to PHP n really need HELP! I've coded a normal feedback form and it works perfect. BUT the problem is that the browsers are able to go back and re-submit the form AGAIN n AGAIN..... The form is not obviously not cleared whn they hit the back button and they are able to post the feedback form(mail) continusly.. Its a nuisance. Can any 1 help me with this issue????? Quote Link to comment https://forums.phpfreaks.com/topic/51442-php-form-mail/ Share on other sites More sharing options...
neel_basu Posted May 15, 2007 Share Posted May 15, 2007 Ok send a Cookie to user's browser after the mail sent like mailsent = 1 and while loading the mail Page first Check weather the Cookie mailsent = 0 or not. Quote Link to comment https://forums.phpfreaks.com/topic/51442-php-form-mail/#findComment-253345 Share on other sites More sharing options...
PHP-POWER Posted May 15, 2007 Author Share Posted May 15, 2007 <? $msg .= "COMPANY DETAILS\n"; $msg .= "------------------\n\n"; $msg .= "Company Name : ".$_POST['cname']."\n"; $msg .= "Website : ".$_POST['web']."\n"; $msg .= "City : ".$_POST['city']."\n"; $msg .= "Country : ".$_POST['country']."\n"; $msg .= "Address 1 : ".$_POST['add1']."\n"; $msg .= "Address 2 : ".$_POST['add2']."\n"; $msg .= "Phone : ".$_POST['phone']."\n"; $msg .= "Fax : ".$_POST['fax']."\n"; $msg .= "Mobile : ".$_POST['mobile']."\n"; $msg .= "Email : ".$_POST['email']."\n"; $msg .= "Comments : ".$_POST['comm']."\n"; $to = "test@domain.com"; $subject = "Website Feedback Form"; mail($to, $subject, $msg, "From: $fname $lname<$email>"."\r\n"."CC:test2@domain.com"); ?> This is the php code. Quote Link to comment https://forums.phpfreaks.com/topic/51442-php-form-mail/#findComment-253374 Share on other sites More sharing options...
nikkieijpen Posted May 15, 2007 Share Posted May 15, 2007 cookie example: if(!isset($_COOKIE["mailsent"])) { $mail = mail($to, $subject, $msg, "From: $fname $lname<$email>"."\r\n"."CC:test2@domain.com"); if($mail) { setcookie("mailsent", "1", time()+3600); } } Quote Link to comment https://forums.phpfreaks.com/topic/51442-php-form-mail/#findComment-253391 Share on other sites More sharing options...
PHP-POWER Posted May 15, 2007 Author Share Posted May 15, 2007 the code doesn't seem to work Quote Link to comment https://forums.phpfreaks.com/topic/51442-php-form-mail/#findComment-253460 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.