Faux graphic security for forms

    Date: 12/30/06 (Javascript Community)    Keywords: css, html, java, security, spam

    I have an old site thats getting spammed so I created this faux graphic security script
    First: create several of those graphics with numbers+letter strings (this example uses 5)
    This script hides the form (with CSS) until the correct value entered
    if anything, it will slow them down and should block some bots.
    Sorry the formatting is all jacked up - its a montage of old script an new :)


    JAVASCRIPT IN EXTERNAL FILE sk.js

    //faux graphic security

    title = new Array(5);
    title[0] = 'securitykey00.gif'
    title[1] = 'securitykey01.gif'
    title[2] = 'securitykey02.gif'
    title[3] = 'securitykey03.gif'
    title[4] = 'securitykey04.gif'

    index = Math.floor(Math.random() * title.length);

    document.write("Please enter number to continue to add listing.");
    document.write("
    ");
    document.write("");
    document.write("");
    document.write("");
    document.write("
    ");



    function compareVal(location)
    {
    title = new Array(5);
    title[0] = 'a3f67j9L';
    title[1] = 'K1yp97E';
    title[2] = 'Ww253Gh';
    title[3] = '6K6k6K2';
    title[4] = 'wKrP738';

    value = document.getElementById("testvalue").value;

    if(title[location] == value)
    {
    document.getElementById("form").style.display = "inline";
    document.getElementById("security").style.display = "none";
    } else {
    alert("Please enter the correct value.");
    }

    //alert(location +" - "+value);
    }

    HTML AND CSS





    ***put the form here***

    Source: http://community.livejournal.com/javascript/122818.html

« prototype Event.stopObserving || Fun game »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home