please help me in numeric captcha

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    please help me in numeric captcha

    How to add random numeric value captcha without images in a script. How to make it work
    please provide code.

    #2
    PHP Code:
    <?php
    function mathcaptcha()
    {
    $x=rand(1,9);
    $y=rand(1,9);
    $_SESSION['result'] = $x $y;
    $math $x.' + '.$y.' = ';
    $math .= "<input size="30" maxlength="20" type="text" name="captcha" />";
    return 
    $math
    }

    function 
    checkcaptcha()
    {
    $result false;
    $check = isset($_SESSION['result']) ? $_SESSION['result'] : 'none'
    unset(
    $_SESSION['result']);

    if(
    is_numeric($check) && is_numeric($_POST['captcha']) && ($check == $_POST['captcha'])) 
    {
    $result true

    return 
    $result
    }
    ?>

    Comment


      #3
      Captcha without image is === NULL.
      A bot can easily pass that.
      If you really dont want with image you can put random questions but you wont be 99% sure about the 'protection'.
      <?php unlink('World/Europe/Romania.country'); ?>

      Comment


        #4
        especially robot access needed on web, so we can just block bot access via .htaccess, that could be better either :p

        Comment

        Working...
        X