PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/jquery-validate/demo/captcha/index.php

#
PHP | 66 lines | 46 code | 14 blank | 6 comment | 0 complexity | 1d95a555255e2913d6b54c62b7998856 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <?php
  2. // Make the page validate
  3. ini_set('session.use_trans_sid', '0');
  4. // Include the random string file
  5. require 'rand.php';
  6. // Begin the session
  7. session_start();
  8. // Set the session contents
  9. $_SESSION['captcha_id'] = $str;
  10. ?>
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  12. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  13. <head>
  14. <title>AJAX CAPTCHA</title>
  15. <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  16. <meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" />
  17. <meta name="description" content="An AJAX CAPTCHA script, written in PHP" />
  18. <script type="text/javascript" src="../../lib/jquery.js"></script>
  19. <script type="text/javascript" src="../../jquery.validate.js"></script>
  20. <script type="text/javascript" src="captcha.js"></script>
  21. <link rel="stylesheet" type="text/css" href="style.css" />
  22. <style type="text/css">
  23. img { border: 1px solid #eee; }
  24. p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; }
  25. p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; }
  26. fieldset label { display: block; }
  27. fieldset div#captchaimage { float: left; margin-right: 15px; }
  28. fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; }
  29. fieldset input#submit { display: block; margin: 2% 0% 0% 0%; }
  30. #captcha.success {
  31. border: 1px solid #49c24f;
  32. background: #bcffbf;
  33. }
  34. #captcha.error {
  35. border: 1px solid #c24949;
  36. background: #ffbcbc;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1>
  42. <form id="captchaform" action="">
  43. <fieldset>
  44. <div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div>
  45. <label for="captcha">Enter the characters as seen on the image above (case insensitive):</label>
  46. <input type="text" maxlength="6" name="captcha" id="captcha" />
  47. <input type="submit" name="submit" id="submit" value="Check" />
  48. </fieldset>
  49. </form>
  50. <p>If you can&#39;t decipher the text on the image, click it to dynamically generate a new one.</p>
  51. </body>
  52. </html>