I don’t have a lot of experience with PHP – I used a form generator to create this form. The problem is that the form is sending hundreds of blank emails. Can anyone please help me fix it? Here’s the PHP code:
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
mail("blah@blah.com","MESSAGE: website","
Someone has submitted a message from your website! Huzzah!
--------------------------------------------------------------------------------
CONTACT INFO:
" . $_POST['field_1'] . "
" . $_POST['field_2'] . "
MESSAGE:
" . $_POST['field_3'] . "
--------------------------------------------------------------------------------
Also you're a stud.
");
header("Refresh: 0;url=http://www.blah.com/thanks.html");
?>
If you just ensure that someone actually
POSTed data through (i.e. actually used the form) you’ll be good to go: