Hi all.
It's been a while since i worked with a guy who set up these type of contact forms for me. He (and people here!) told me how to put lots of funky security in the PHP to stop spam from bots etc.
He gave me a really detailed send.php which included stuff like blocking sends where the users email address is the same as the domain (a typical bot trick it seems) and some more. However trying to make that file work has completely confused me, so i've gone back the the basic version
I know there's some pro's on here, so can anyone make some simple additions to this for me? All it has on is a timer.
Much appreciated!
EDIT: I had a read through the thread in the archive and couldnt really make anything work
It's been a while since i worked with a guy who set up these type of contact forms for me. He (and people here!) told me how to put lots of funky security in the PHP to stop spam from bots etc.
He gave me a really detailed send.php which included stuff like blocking sends where the users email address is the same as the domain (a typical bot trick it seems) and some more. However trying to make that file work has completely confused me, so i've gone back the the basic version

I know there's some pro's on here, so can anyone make some simple additions to this for me? All it has on is a timer.

Much appreciated!
PHP:
<?
session_start();
if ($_SESSION['lastmailed'] + 60 < time()) {
// send mail
$recipient = "[email protected]";
$subject = "my subject goes here";
$sender = stripslashes($_POST[ "email" ]);
$msg .= "Name: ".stripslashes($_POST[ "name" ])."\r\n";
$msg .= "Email: ".stripslashes($_POST[ "email" ])."\r\n";
$msg .= "Subject: ".stripslashes($_POST[ "subject" ])."\r\n";
$msg .= "Message: ".stripslashes($_POST[ "message" ])."\r\n";
//$msg .= "".$_POST[ "" ]."\n";
mail( $recipient, $subject, $msg, "From: $sender" );
header( "location: thankyou.html" );
$_SESSION['lastmailed'] = time();
} else {
header( "location: form-error.html" );
}
?>
EDIT: I had a read through the thread in the archive and couldnt really make anything work

Last edited: