Advertisement
uzumaxy

HashCode.ru — 245206

Aug 16th, 2013
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.81 KB | None | 0 0
  1.      <?php
  2.         if ( $_SERVER["QUERY_STRING"] ) :
  3.             if ( !isset($_GET['email']) )
  4.             {
  5.                 //mark input#email as incorrect
  6.             } elseif ( !(isset($_GET['pswrd1']) && isset($_GET['pswrd2'])) )
  7.             {
  8.                 //mark both password input as incorrect
  9.             } elseif ( $_GET['pswrd1'] !== $_GET['pswrd2'] )
  10.             {
  11.                 //mark both password input as incorrect
  12.             } else
  13.             {
  14.                 die("Registered successfully‎!");
  15.             }
  16.         endif;
  17.    ?>
  18.     <!DOCTYPE html>
  19.     <html>
  20.       <head>
  21.         <title>Example of non-captcha protection</title>
  22.         <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
  23.         <script>
  24.         var realURL="example.php/?"; //Just replace at needful
  25.         $(function() {
  26.             $("button#doReg").on("click", function() {
  27.                 var params = "email=" + $("input#email").val();
  28.                 params += "&pswrd1=" + $("input#pswrd1").val();
  29.                 params += "&pswrd2=" + $("input#pswrd2").val();
  30.                 params += "&bday=" + $("input#bday").val();
  31.                
  32.                 $(location).attr('href',realURL + params);
  33.             });
  34.         });
  35.         </script>
  36.       </head>
  37.       <body>
  38.         <form action="registration.php" method="GET">  <!--FAKE URL-->
  39.             <fieldset>
  40.                 <legend>Registration:</legend>
  41.                 Email: <input type="email" name="email" id="email" required maxlength="256"><br>
  42.                 Password: <input type="password" name="pswrd1" id="pswrd1" required maxlength="32"><br>
  43.                 Password confirm: <input type="password" name="pswrd2" id="pswrd2" required maxlength="32"><br>
  44.                 Birthday: <input type="date" name="bday" id="bday"><br>
  45.                 <input type="submit" style="display: none;" name="submit" value="ok">
  46.                 <button type="button" id="doReg">Register!</button>
  47.             </fieldset>
  48.         </form>
  49.       </body>
  50.     </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement