LiveSearch

Powered by vanilla & lovin' it!

  1.  
    I'm having a problem with an online form on a website. I think it's being spammed or else some a-hole is doing it manually. Every day it gets filled out with some random name etc.... Somehow they also bypass the required field script (like that the phone number should contain a number). How can they do this? And why? There is no advertising or anything other than annoyance.
    Is there a good way to stop this kind of thing? Should I try to get one of those random letter and number generators and add that? Any recommendation about which one (free is good)? I hope you guys can help since my client is getting kind of annoyed about this.

    Thanks vfb
    •  
      CommentAuthormichael
    • CommentTimeJun 19th 2008
     
    if you want an external solution you can easily include in your contact page/form, try recaptcha: http://recaptcha.net/

    if you need a free captcha-script (written in php) which you can put on your own server have a look here: http://www.captcha.fr/
  2.  
    Yes, I want an easy solution to include in the php form page. I don't have my own server. So, thanks.. I'll look at the first one.
  3.  
    Ok, I have successfully put this recapcha script in the form and it works. Now, does anyone know if there is a way to customize the error message which comes up with an incorrectly typed validation? Text colour, bg colour, image etc.?
    Thanks,
    VFB
    •  
      CommentAuthormichael
    • CommentTimeJul 9th 2008
     
    hmm, that depends how you are using the api. isn't it just a string which is put out by the php function? wrap the response in some kind of container and apply some styles to it?
  4.  
    Sorry to be so lame but I can't figure out where or how exactly to put a container around it. I've tried everything I can think of but my coding skills are poor to say the least. I was able to edit the error text but nothing else. I did set some styles for the whole page on which it appears, and that worked, but it broke the redirect after a correct response.

    This is how the code looks at what I think is the appropriate part. I'm lost and I know it doesn't matter so much, but it would be nice if it was consistent with the rest of the site.

    require_once('recaptchalib.php');
    $privatekey = "xxxxxxxxxxx";
    $resp = recaptcha_check_answer ($privatekey,
    $_SERVER["REMOTE_ADDR"],
    $_POST["recaptcha_challenge_field"],
    $_POST["recaptcha_response_field"]);

    if (!$resp->is_valid) {
    die ("Sorry, that verification wasn't entered correctly." .

    " Please use the back button to return and try again.");
    }
    •  
      CommentAuthormichael
    • CommentTimeJul 9th 2008
     
    you can put style directives around the error message like this:

    die ("<span class=\"styleforerrormessage\">Sorry, that verification wasn't entered correctly.<br /><br />Please use the back button to return and try again.</span>";);
  5.  
    thanks so much for the clear instructions but for some reason I can't get to to work. I must be doing something wrong.

    What I have added is as follows:

    instead of :
    ("<span class=\"styleforerrormessage\">

    I put as a test:

    ("<span class= \font-size: 18px;
    color: #990000; background-color: #F9E8D4;\">


    It doesn't break it but no style shows up.
  6.  
    you have used style="" instead of class=""?