Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Captcha - captcha.php

captcha.php

Caricato da: Roby94
Scarica il programma completo

  1. <?php
  2. <html>
  3.   <head>
  4.     <title>Captcha</title>
  5.     <script>
  6.     //Ricarica immagine captcha//
  7.     function reload_captcha() {
  8.         document.getElementById('img_captcha').src = 'include/images/captcha.php?reload='+ Math.random();//cambio l'immagine captcha
  9.     }
  10.     </script>
  11.   </head>
  12.   <body>
  13. <?      if(isset($_POST['submit'])) {
  14.                 if($_SESSION['captcha'] == strtoupper($_POST['captcha'])) {?>
  15.                         <font style="color:#0C0;">Codice corretto!</font>
  16. <?              } else {?>
  17.             <font style="color:#F00;">Codice errato!</font>
  18. <?              }
  19.         }
  20.         ?>
  21.     <form method="post">
  22.       <input name="submit" type="hidden">
  23.       <table width="300px">
  24.         <tr>
  25.           <td><a href="#" onClick="reload_captcha();"><img src="include/images/reload.png" border="0"/></a></td>
  26.           <td><img id="img_captcha" src="include/images/captcha.php" /></td>
  27.         </tr>
  28.         <tr>
  29.           <td>Codice:</td>
  30.           <td><input name="captcha" type="text" /></td>
  31.         </tr>
  32.         <tr>
  33.           <td colspan="2"><input type="submit" value="Verifica!" /></td>
  34.         </tr>
  35.       </table>
  36.     </form>
  37.   </body>
  38. </html>