Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( $_SERVER["QUERY_STRING"] ) :
- if ( !isset($_GET['email']) )
- {
- //mark input#email as incorrect
- } elseif ( !(isset($_GET['pswrd1']) && isset($_GET['pswrd2'])) )
- {
- //mark both password input as incorrect
- } elseif ( $_GET['pswrd1'] !== $_GET['pswrd2'] )
- {
- //mark both password input as incorrect
- } else
- {
- die("Registered successfully!");
- }
- endif;
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Example of non-captcha protection</title>
- <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
- <script>
- var realURL="example.php/?"; //Just replace at needful
- $(function() {
- $("button#doReg").on("click", function() {
- var params = "email=" + $("input#email").val();
- params += "&pswrd1=" + $("input#pswrd1").val();
- params += "&pswrd2=" + $("input#pswrd2").val();
- params += "&bday=" + $("input#bday").val();
- $(location).attr('href',realURL + params);
- });
- });
- </script>
- </head>
- <body>
- <form action="registration.php" method="GET"> <!--FAKE URL-->
- <fieldset>
- <legend>Registration:</legend>
- Email: <input type="email" name="email" id="email" required maxlength="256"><br>
- Password: <input type="password" name="pswrd1" id="pswrd1" required maxlength="32"><br>
- Password confirm: <input type="password" name="pswrd2" id="pswrd2" required maxlength="32"><br>
- Birthday: <input type="date" name="bday" id="bday"><br>
- <input type="submit" style="display: none;" name="submit" value="ok">
- <button type="button" id="doReg">Register!</button>
- </fieldset>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement