You are here: Avoiding double-submissions with mail script « PHP Programming Language « IT news, forums, messages
Avoiding double-submissions with mail script

Posted by Chuck W. on 02/01/06 19:49

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_name = \"". $_POST["last_name"] .
"\",title = \"" . $_POST["title"] . "\", company = \"" .
$_POST["company"] . "\", leadsource = \"" . $_POST["lead_source"] ;

$headers .= 'From: Sender <sender@blahblah.com>' . "\r\n";
$subject = 'New record notification';
$to = 'recipient@blahblah.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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация