1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Security Code Script

Discussion in 'PHP' started by nevetS, Sep 17, 2005.

  1. #1
    I'm developing a web form that's going to be public and with the rash of form spam I've seen on other public forms, I'd like to include a security code to validate that it is not a bot sending in the script.

    I could probably develop my own with imagemagick and php, but I'm wondering if anybody doesn't have a link out there to an existing script that will handle this for me and works well.
     
    nevetS, Sep 17, 2005 IP
  2. jewellery

    jewellery Guest

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
  3. piniyini

    piniyini Well-Known Member

    Messages:
    514
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    170
  4. DavidAusman

    DavidAusman Peon

    Messages:
    399
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can create a random number for validation
     
    DavidAusman, Sep 22, 2005 IP
  5. HolyMan

    HolyMan Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK... for all us newbies out there....... explain please!!!!!
     
    HolyMan, Sep 23, 2005 IP
  6. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #6
    Well, you could do something like :
    <?
    sessionstart();
    $validate = mt_rand(0,100);
    session_register("validate");
    ?>
    And then print out $validate later and compare that to a posted value. Not such a bad idea, except any automated bot could read the value since you printed it.
     
    nevetS, Sep 23, 2005 IP
  7. Connect

    Connect Guest

    Messages:
    191
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    To get started this is ok. But as nevetS said, a smart bot could read the random number and beat your security system. An image would be much more difficult to read by the bot.

    I am also using http://www.cocoavillagepublishing.com/development/tools/php/scripts/

    ;)
     
    Connect, Sep 23, 2005 IP