So I have a very simple mail script just to send a quick 'n dirty
notification of a form posting -- it goes like this:
$message = $_POST["salutation "] . "\", first_name = \"".
$_POST["first_name "] . "\",last_na me = \"". $_POST["last_name"] .
"\",title = \"" . $_POST["title"] . "\", company = \"" .
$_POST["company"] . "\", leadsource = \"" . $_POST["lead_sourc e"] ;
$headers .= 'From: Sender <sender@blahbla h.com>' . "\r\n";
$subject = 'New record notification';
$to = 'recipient@blah blah.com';
// Mail it
mail($to, $subject, $message, $headers);
Crude, huh. Works though.
So I'm wondering how can I code this thing so when someone hits the
submit button on the form twice it doesn't send two email messages (or
more)? Wrap a session variable around it somehow?
Thanks,
Chuck
PHP Noob
notification of a form posting -- it goes like this:
$message = $_POST["salutation "] . "\", first_name = \"".
$_POST["first_name "] . "\",last_na me = \"". $_POST["last_name"] .
"\",title = \"" . $_POST["title"] . "\", company = \"" .
$_POST["company"] . "\", leadsource = \"" . $_POST["lead_sourc e"] ;
$headers .= 'From: Sender <sender@blahbla h.com>' . "\r\n";
$subject = 'New record notification';
$to = 'recipient@blah blah.com';
// Mail it
mail($to, $subject, $message, $headers);
Crude, huh. Works though.
So I'm wondering how can I code this thing so when someone hits the
submit button on the form twice it doesn't send two email messages (or
more)? Wrap a session variable around it somehow?
Thanks,
Chuck
PHP Noob
Comment