PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/php4/valImage_v1/sample_form.php

http://flaimo-php.googlecode.com/
PHP | 44 lines | 29 code | 2 blank | 13 comment | 2 complexity | 2e582ac94bb66c7a96d21fd3173fe89e MD5 | raw file
  1. <?php
  2. //+----------------------------------------------------------------------+
  3. //| WAMP (XP-SP1/1.3.27/4.0.12/4.3.3) |
  4. //+----------------------------------------------------------------------+
  5. //| Copyright (c) 1992-2003 Michael Wimmer |
  6. //+----------------------------------------------------------------------+
  7. //| Authors: Michael Wimmer <flaimo 'at' gmx 'dot' net> |
  8. //| Rafael Machado Dohms <dooms 'at' terra 'dot' com 'dot' br> |
  9. //+----------------------------------------------------------------------+
  10. //
  11. // $Id$
  12. /**
  13. * @package valImage
  14. */
  15. error_reporting(E_ALL & E_NOTICE);
  16. ob_start();
  17. session_start();
  18. require_once 'class.valimage.inc.php';
  19. $vi = new valImage();
  20. if (isset($_POST[$vi->getFormName()])) { // only validate if form was send
  21. $message = (($vi->checkCode() === TRUE) ? 'Your Input is correct' : 'Your Input is wrong.');
  22. } else {
  23. $message = '';
  24. } // end if
  25. ?>
  26. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  27. <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  28. <head>
  29. <title>valImage Sample Form</title>
  30. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  31. </head>
  32. <body>
  33. <h2><?php echo $message; ?></h2>
  34. <form name="sampleform" id="sampleform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  35. <p>Please type the characters in the picture into the input box and hit Validate (Characters are case-sensitive).</p>
  36. <img src="image_valimage.php" alt="validateImage" /><br />
  37. <input name="<?php echo $vi->getFormName(); ?>" type="text" id="<?php echo $vi->getFormName(); ?>" size="7" /><br />
  38. <input name="send" type="submit" value="Validate" />
  39. </form>
  40. </body>
  41. </html>
  42. <?php ob_end_flush(); ?>