Captcha ?!

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

    Captcha ?!

    Can anyjone tell the simplies way to add captcha...

    I've tried by watching that on other scripts, but i cant make my own...

    Please explain the process, it will be very good if also can add some previews...

    #2
    Save this as captcha.php
    PHP Code:
    <?php
    header
    ('content-type: image/jpeg');
    $height 25;
    $width 55;
    $image_p imagecreate($width,$height);
    $black imagecolorallocate($image_p,0,0,0);
    $white imagecolorallocate($image_p,255,255,255);
    $font_size 14;
    imagestring($image_p,$font_size,5,5,"".$_GET['text']."",$white);
    imagejpeg($image_p,null,80);
    ?>
    then in ur register form
    PHP Code:
    $text rand(11111,99999);
    $rform .= "Image Verification\n<br/>\n<img src=\"captcha.php?text=$text\" alt=\"captcha\"/> = <input type=\"text\" format=\"*n\" name=\"ucans\" maxlength=\"5\" size=\"2\"/><br/>\n";
    $rform .= "<input type=\"hidden\" name=\"rcans\" value=\"$text\"/>\n"
    and in your register.php
    PHP Code:
    $ucans $_POST["ucans"];
    $rcans $_POST["rcans"];
    if(
    $ucans!=$rcans) echo "Wrong Image Verification!"
    try diz..i just typed it now..don't know if it'll work and if u understand..just analyze..
    My Blog: http://jhommark.blogspot.com
    My Facebook: http://www.facebook.com/jhommark
    My Official Site: http://www.undergroundweb.tk
    My Community Site: http://undergroundwap.xtreemhost.com

    Comment


      #3
      Demo: Registration | UnderGroundWAP and captcha http://undergroundwap.co.cc/captcha....One=1&numTwo=2 param val of numOne is 1 and numTwo is 2..Their sum should be 3..this is different from what i've previously posted coz i use sum of 2 numbers and i just use random numbers in my post here..
      My Blog: http://jhommark.blogspot.com
      My Facebook: http://www.facebook.com/jhommark
      My Official Site: http://www.undergroundweb.tk
      My Community Site: http://undergroundwap.xtreemhost.com

      Comment


        #4
        Originally posted by kiLLeR-eyEd_14 View Post
        Demo: Registration | UnderGroundWAP and captcha http://undergroundwap.co.cc/captcha....One=1&numTwo=2 param val of numOne is 1 and numTwo is 2..Their sum should be 3..this is different from what i've previously posted coz i use sum of 2 numbers and i just use random numbers in my post here..
        where is the code of captcha.Php?

        Comment


          #5
          Try my captcha.php better

          PHP Code:
          <?php
          session_id
          ("".$_GET['sid']."");
          session_start();
              
          $string=rand(1000,10000);
              
          $_SESSION['ref'] = $string;
              
          Header("Content-type: image/gif");
              
          $im ImageCreateFromGif("img.gif");
              
          $orange ImageColorAllocate($im000);
              
          $px = (imagesx($im)-7.5*strlen($string))/2;
              
          ImageString($im,3,$px,1,$string,$orange);
              
          ImageGif($im);
              
          ImageDestroy($im);
          ?>
          I dont know why, yours not workin for me..
          Last edited by Malka1; 10.04.10, 11:02.

          Comment


            #6
            O.K i've found anauther way, btw thanx for previews, now i understand how "stuff" works.

            O.K My preview:

            Post it at Your input field
            PHP Code:
            echo "*Security code:<br/>\n";
            $r1=rand(0,100); $r2=rand(0,100); $r3=rand(0,100); $rand="$r1$r2$r3";
            echo 
            "<small><b>$rand</b></small><br/>\n";
            echo 
            "<input name=\"code\" maxlength=\"9\" title=\"infa\" emptyok=\"false\"/><br/>\n"
            On postfield field place this:
            PHP Code:
            <postfield name=\"code\" value=\"$(code)\"/>
            <postfield name=\"kod\" value=\"
            $rand\"/> 
            At the register page place this:
            PHP Code:
            if ($code=="") {
            die
            (print 
            "Enter security code!<br/>
            </small></p></card></wml>"
            );
            }
            if (
            $code !== $kod) {
            die
            (print 
            "Wrong security code!<br/>
            </small></p></card></wml>"
            );

            Hope this helps someone ;)

            P.S that works on wml, on html have probs
            Last edited by Malka1; 10.04.10, 11:39.

            Comment


              #7
              That's also what i have before but i removed the session thing coz other mobile doesn't support session or cookies..i think of how i could make it work w/o using cookies to store the captcha..So i think, my idea is better..
              My Blog: http://jhommark.blogspot.com
              My Facebook: http://www.facebook.com/jhommark
              My Official Site: http://www.undergroundweb.tk
              My Community Site: http://undergroundwap.xtreemhost.com

              Comment


                #8
                If u're gonna make it in html, u should use <form><input>
                My Blog: http://jhommark.blogspot.com
                My Facebook: http://www.facebook.com/jhommark
                My Official Site: http://www.undergroundweb.tk
                My Community Site: http://undergroundwap.xtreemhost.com

                Comment

                Working...
                X