security code for register

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

    security code for register

    some1 has a security code script along numbers/letters system ,to
    put on register.php (wapdesire/lava) for to
    prevent fake
    registration and spamming ?
    sigpicthe italian/international COMMUNITY of friendship
    http://people2000.netne.net
    WAP/WEB
    peoplemailbox@katamail.com

    #2
    Originally posted by honkytonkman View Post
    some1 has a security code script along numbers/letters system ,to
    put on register.php (wapdesire/lava) for to
    prevent fake
    registration and spamming ?
    like mine?My site is a wapdesire edit
    http://yuhjiwap.co.cc/register
    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
      Search google 4 captcha snippet or use plain text like:

      Code:
      function regSimpleAuth(){
      $num1 = rand(1,20); $num2 = rand(1,20);
      $ans = $num1 + $num2;
      return array('question'=>'$num1 + $num2','answer'=>'$ans');
      }
      
      //reg page
      $auth = regSimpleAuth();
      $_SESSION['ans'] = $auth['answer'];
      echo 'Are u human?<br/>'.$auth['question'].' = ';
      echo '<input type="text" name="authSum" value="?" size="3" maxlength="3"/><br/>';
      
      //use this in validation
      if($_POST['authSum']!= $_SESSION['ans']){
      echo 'Incorrect validation answer. E.g 8+8=16';
      }else{
      //continue registration
      }
      hope that helps.

      Comment


        #4
        Originally posted by mobileGIGS View Post
        Search google 4 captcha snippet or use plain text like:

        Code:
        function regSimpleAuth(){
        $num1 = rand(1,20); $num2 = rand(1,20);
        $ans = $num1 + $num2;
        return array('question'=>'$num1 + $num2','answer'=>'$ans');
        }
        
        //reg page
        $auth = regSimpleAuth();
        $_SESSION['ans'] = $auth['answer'];
        echo 'Are u human?<br/>'.$auth['question'].' = ';
        echo '<input type="text" name="authSum" value="?" size="3" maxlength="3"/><br/>';
        
        //use this in validation
        if($_POST['authSum']!= $_SESSION['ans']){
        echo 'Incorrect validation answer. E.g 8+8=16';
        }else{
        //continue registration
        }
        hope that helps.
        tnx 4 diz..
        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


          #5
          Originally posted by kiLLeR-eyEd_14 View Post
          tnx 4 diz..
          anytime mate :-)

          Comment


            #6
            Where can i post that code?
            LESS TALK. LESS MISTAKE.

            HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

            Comment


              #7
              Or u myt prefer a captcha image script
              PHP Code:
              <?php
              $font 
              'arial.ttf';
              $lineCount 10;
              $fontSize 10;
              $height 25;
              $width 80;
              $ih imagecreate($width,$height) or die('GD Library must be installed.');
              $bgColor imagecolorallocate($ih,0,0,0);
              $lineColor imagecolorallocate($ih,178,238,238);
              $txtColor imagecolorallocate($ih,255,255,255);
              $str 'abcdefghijklmnopqrstuvwxyz0123456789';
              for(
              $x=0;$x<6;$x++){
              $pos rand(0,strlen($str));
              $stri .= $str{$pos};
              }
              $textbox imagettfbox($fontSize,0,$font,$stri) or die('Try replacing imagettfbox with imagettfbbox function on d left.');
              $x = ($width $textbox[4])/2;
              $y = ($height $textbox[5])/2;
              imagettftext($ih,$fontSize,0,$x,$y,$txtColor,$font,$stri);
              for(
              $x=0;$x<$lineCount;$x++){
              $x1 rand(0,$width); $x2rand(0,$width); $y1 rand(0,$width); $y2 rand(0,$width);
              imageline($ih,$x1,$y1,$x2,$y2,$lineColor);
              }
              header('Content-type: image/jpeg');
              imagejpeg($ih,NULL,75);
              imagedestroy($ih);
              session_start();
              $_SESSION['captchaAuth'] = $stri;
              ?>
              Store that code above as captchaimage.php
              Code:
              //the form
              echo '<img src="captchaimage.php" alt="captcha"/><br/>Enter text above:<input type="text" maxlength="6" name="auth"/>';
              
              //the authentication
              session_start();
              if($_POST['auth']!=$_SESSION['captchaAuth']){ echo 'Incorrect code, try again. Note: cAsE SenSITivE VaLUE';
              }else{
              //continue reg
              }
              Remember, download arial.ttf FONT, and save it in d same directory as ur php code. You can get one in ur windows folder on any pc. C:\WINDOWS\FONT(or fonts)
              Last edited by CreativityKills; 20.08.09, 07:54.

              Comment


                #8
                i cant make it work can sombody help me :::

                //reg page
                $auth = regSimpleAuth();
                $_SESSION['ans'] = $auth['answer'];
                echo 'Are u human?<br/>'.$auth['question'].' = ';

                it shows error like :
                Are u human?
                $num1 + $num2 =

                the numbers does not show
                echo '<input type="text" name="authSum" value="?" size="3" maxlength="3"/><br/>';

                Comment


                  #9
                  Put regSimpleAuth function in same file, add session_start()

                  Comment


                    #10
                    Originally posted by bijaybd View Post
                    i cant make it work can sombody help me :::

                    //reg page
                    $auth = regSimpleAuth();
                    $_SESSION['ans'] = $auth['answer'];
                    echo 'Are u human?<br/>'.$auth['question'].' = ';

                    it shows error like :
                    Are u human?
                    $num1 + $num2 =

                    the numbers does not show
                    echo '<input type="text" name="authSum" value="?" size="3" maxlength="3"/><br/>';
                    try,
                    $question = "$num1 + $num2";
                    then in array('question'=>'".$question."');
                    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


                      #11
                      still it shows error for me :

                      Are u human?
                      ".$question." =
                      in the registration page:


                      my code is :



                      function regSimpleAuth(){
                      $num1 = rand(1,20); $num2 = rand(1,20);
                      $ans = $num1 + $num2;
                      return array('question'=>'".$question."');
                      }


                      $auth = regSimpleAuth();
                      $_SESSION['ans'] = $auth['answer'];
                      echo "Are u human?<br/>".$auth['question']." = ";
                      echo "<input type=\"text\" name=\"authSum\" value=\"?\" size=\"3\" maxlength=\"3\"/><br/>";


                      anybody can fix it please

                      Comment


                        #12
                        Originally posted by bijaybd View Post
                        still it shows error for me :

                        Are u human?
                        ".$question." =
                        in the registration page:


                        my code is :



                        function regSimpleAuth(){
                        $num1 = rand(1,20); $num2 = rand(1,20);
                        $ans = $num1 + $num2;
                        return array('question'=>'".$question."');
                        }


                        $auth = regSimpleAuth();
                        $_SESSION['ans'] = $auth['answer'];
                        echo "Are u human?<br/>".$auth['question']." = ";
                        echo "<input type=\"text\" name=\"authSum\" value=\"?\" size=\"3\" maxlength=\"3\"/><br/>";


                        anybody can fix it please
                        PHP Code:


                        function regSimpleAuth(){
                        $num1 rand(1,20); $num2 rand(1,20);
                        $ans $num1 $num2;
                        $auth['question'] = "$num1 + $num2";
                        $auth['answer'] = $num1 $num2;
                        return 
                        $auth;
                        }


                        $auth regSimpleAuth();
                        $_SESSION['ans'] = $auth['answer'];
                        echo 
                        "Are u human?<br/>".$auth['question']." = ";
                        echo 
                        "<input type=\"text\" name=\"authSum\" value=\"?\" size=\"3\" maxlength=\"3\"/><br/>"
                        That shud defo work. If u have validation problems, go to the top of page(s) wher u have d script, and add

                        session_start();

                        Comment


                          #13
                          not working for me in the last step after entering it continuesly showing error :

                          my code is this can someone fix it :




                          in dbconfig.php file :
                          function regSimpleAuth(){
                          $num1 = rand(1,20); $num2 = rand(1,20);
                          $ans = $num1 + $num2;
                          $auth['question'] = "$num1 + $num2";
                          $auth['answer'] = $num1 + $num2;
                          return $auth;
                          }


                          here is the register page :

                          $auth = regSimpleAuth();
                          $_SESSION['ans'] = $auth['answer'];
                          echo "Are u human?*<br/>".$auth['question']." = ";
                          echo "<input type=\"text\" name=\"authSum\" value=\"\" size=\"3\" maxlength=\"3\"/><br/>";


                          echo "<small><anchor>&#187;Register";
                          echo "<postfield name=\"authSum\" value=\"$(authSum)\"/>\n";
                          echo "</anchor>";


                          and here is the 2nd proccessing in the same registration page :

                          if($_POST['authSum']!= $_SESSION['ans']){
                          echo "The Human Varification code is wrong please enter the varification code again to register.Example : 4+15=19 the answer should be like this.";
                          echo "</p></card></wml>";
                          ob_end_flush();
                          exit();
                          }

                          so where do i making the mistake help me

                          Comment

                          Working...
                          X