Wallpaper Script Forum » Plugins and Hacks

Adding Captcha to Register-Anti Spam

(1 post)
  • Started 1 year ago by maihannijat
  1. Hello,

    We are all tired of spam, everyday users submitting spam photos. it really sucks deleting each of them and takes lots of time.

    Finally I have decided to add WallpaperScript built in Captcha for my site, this works great.

    Have a look to my Afghanistan Photos website for demo: http://www.afgpictures.com

    Here are step by step guide how to install Built in capctcha for your website:

    1. Open register.inc.php which is located in root directory.

    Find:

    if ($_REQUEST["email"]=="")
    {
    $siteError->add($LANG->l('Email required'), "error");
    }

    And add this code below above code.

    if (ENABLE_CAPTCHA==1)
    {
    if( (Tools::isSubmit('register')) and isset($_SESSION['security_code']) ) {
    if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {

    unset($_SESSION['security_code']);
    } else {
    $siteError->add($LANG->l('Sorry, you have provided an invalid security code'));
    }
    }
    }

    2. Open /templates/default/register.tpl

    Find:

  2. <label for="confirm_password">{l s='Confirm Password:'}</label><?=$WS->show_input(array("type"=>"password", "name"=>"confirm_password", "class" => "input-text"))?>
  3. Add this after above code.

    {if $smarty.const.ENABLE_CAPTCHA==1}

  4. <label for="security_code">{l s='Security Code:'}</label>{input type='captcha' name='security_code' id='security_code' class='input-text'}
  5. {/if}

    This is all but make sure your Captcha module is installed from your admin area.

Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.