Form validation to prevent spam entries

  megat193 13:36 18 Apr 07
Locked

'Comments' features on web newspaper sites use an image validation, a series of numbers and letters, before allowing a post to be submitted. Is this a complicated procedure, or can it be incorporated into basic websites?

  harristweed 08:56 19 Apr 07

I think it’s simple, just have a few images with code on, chosen at random. If the code field on the form doesn’t match the image, don’t send!
Something like…
<?php
$error = 0;
if ($code!=="$form_field")
{
$error = $error +1;
$message = $message."Please enter correct code";
}
if($error ==0 and $Submit=="Submit")
{
// submit post
}else{
//display message and form again
}
?>

  megat193 17:43 19 Apr 07

Thanks, I'll give it a go.

This thread is now locked and can not be replied to.

Surface Pro 5 News - release date, UK price, features, specs

Animator Emanuele Kabu’s psychedelic video is a stunning tribute to Lisbon city

Best Mac antivirus 2017