Hi, I'm using this php script I made myself...
On my website I have a page called Contact, so you can send an email to me using a simple form.
To decrease spam messages I added a simple validation script:
That's the code I use to validate..
Question is, how safe is it against spam bots?
Could they just take for example 15+15 and turn it into 30 then paste it into the text box and send?
Should I use captcha or something instead to be on the safe side`?
On my website I have a page called Contact, so you can send an email to me using a simple form.
To decrease spam messages I added a simple validation script:
Code:
contact.php
$num1 = rand(1,20);
$num2 = rand(1,20);
<input type="hidden" name="numb1" value="<?php echo $num1 ?>" />
<input type="hidden" name="numb2" value="<?php echo $num2 ?>" />
<span class="style1">What is: <?php echo $num1 . "+" . $num2 . "?" ?></span>
<input type="text" name="validator" size="35" />
<input type="submit" value="Send Mail" />
send.php
$sum1 = $_POST['numb1']+$_POST['numb2'];
if ($sum1 != $_POST['validator']) {
die ("Validation code is not correct!");
}
That's the code I use to validate..
Question is, how safe is it against spam bots?
Could they just take for example 15+15 and turn it into 30 then paste it into the text box and send?
Should I use captcha or something instead to be on the safe side`?