Hey all,
I have a mailform in flash that works great…
only problem is that at the end of the .php file
I have this clearing the fields in flash:
[COLOR=green]print[/COLOR] [COLOR=darkred]"&contact_bg.contact_inside.MessageLong=&"[/COLOR][COLOR=green];[/COLOR]
it works, but the variables are still there.
If the person clicks again I get two emails…
(same if they click 20 times )
I would like to clear the variables and be able to
prevent double-clicking from sending two messages.
here is the complete script:
<?php
$vars = array("name", "email", "message_l", "mail_list", "city", "links", "recip");
foreach($vars as $var)
if(isset($_POST[$var]))
$$var = $_POST[$var];
else
$$var = '';
if(strlen($name) < 2)
die("&contact_bg.contact_inside.status1=please enter your name&");
if(!eregi('^([a-z0-9\._-])+@([^\.]+\.[^\.]+.*)', $email, $matched))
die("&contact_bg.contact_inside.status1=please enter a correct email address&");
else if(!getmxrr($matched[2], $mxrr))
die("&contact_bg.contact_inside.status1=your mail server does not seem to exist&");
$recip = "info@website.com";
$message = str_replace("\r", "
", $message);
$sender = $_SERVER[REMOTE_ADDR];
$mailbody = "Contact form sent by
Name: $name
Email: $email
City: $city
Links: $links
Join mailing list?: $mail_list
message:
$message_l
-------
sender's ip: $sender";
mail($recip, "Mail From:$name", $mailbody, "From: $email");
print "&contact_bg.contact_inside.status1=your message has been sent&";
print "&contact_bg.contact_inside.BasicName=&";
print "&contact_bg.contact_inside.BasicEmail=&";
print "&contact_bg.contact_inside.BasicCity=&";
print "&contact_bg.contact_inside.BasicLink=&";
print "&contact_bg.contact_inside.MessageLong=&";
?>
thanks in advance~!
[COLOR=orange]-hroth:alien2: [/COLOR]