DaveGears86
Member
I have contact forms on most of the sites I make, occasionally forms are submitted which are empty/contain no data. (bots)
I have put Spry Validations (Dreamweaver) on the fields but this doesn't seem to work when it comes to bots, they can override the validation check and it just gets emailed whether there is data or not.
Now, I know that "Captcha" can be used to filter out bot attempts ...But I don't really want to use captcha on the page. Is there an easier/alternative way? Ideally within the PHP process code? (as I don't really want to amend the web page) I'm looking for an easy solution which will stop these bot attempts from being emailed to me. Any suggestions?
Thanks.
I have included my php code (simple php script which works fine aside from the already stated) -
I have put Spry Validations (Dreamweaver) on the fields but this doesn't seem to work when it comes to bots, they can override the validation check and it just gets emailed whether there is data or not.
Now, I know that "Captcha" can be used to filter out bot attempts ...But I don't really want to use captcha on the page. Is there an easier/alternative way? Ideally within the PHP process code? (as I don't really want to amend the web page) I'm looking for an easy solution which will stop these bot attempts from being emailed to me. Any suggestions?
Thanks.
I have included my php code (simple php script which works fine aside from the already stated) -
Code:
<?php
$mymail = '[email protected]';
$cc = 'Form submitted from MyWebsite.com';
$BoDy = 'A visitor left the following from MyWebsite.com :';
$BoDy .= "\n\n";
$FrOm = 'FROM: MyWebsite.com';
$BoDy .= 'Name: ';
$BoDy .= $_POST['t1'];
$BoDy .= "\n\n";
$BoDy .= 'Email: ';
$BoDy .= $_POST['t2'];
$BoDy .= "\n\n";
$BoDy .= 'Phone: ';
$BoDy .= $_POST['t3'];
$BoDy .= "\n\n";
$BoDy .= 'Comments: ';
$BoDy .= $_POST['t4'];
$BoDy .= "\n\n";
$send = mail("$mymail", "$cc", "$BoDy", "$FrOm");
///Redirect user to your homepage....
if($send)
{
echo '<meta http-equiv="refresh" content="0;URL=/thank-you-page.php">';
}
?>