<?php
<html>
<head>
<title>Captcha</title>
<script>
//Ricarica immagine captcha//
function reload_captcha() {
document.getElementById('img_captcha').src = 'include/images/captcha.php?reload='+ Math.random();//cambio l'immagine captcha
}
</script>
</head>
<body>
<? if(isset($_POST['submit'])) {
if($_SESSION['captcha'] == strtoupper($_POST['captcha'])) {?>
<font style="color:#0C0;">Codice corretto!</font>
<? } else {?>
<font style="color:#F00;">Codice errato!</font>
<? }
}
?>
<form method="post">
<input name="submit" type="hidden">
<table width="300px">
<tr>
<td><a href="#" onClick="reload_captcha();"><img src="include/images/reload.png" border="0"/></a></td>
<td><img id="img_captcha" src="include/images/captcha.php" /></td>
</tr>
<tr>
<td>Codice:</td>
<td><input name="captcha" type="text" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Verifica!" /></td>
</tr>
</table>
</form>
</body>
</html>