Requisitos:
Imagen:
![](http://img147.imageshack.us/img147/7057/capcha.png)
Fuente Deseada: (en este caso se usa una fuente Arial TrueType)
captcha.php
Código php:
Ver original
<?php $button_text =$_SESSION['captcha']; { echo "ERROR"; exit; } $width_image_wo_margin = $width_image - (2 * 8); $height_image_wo_margin = $height_image - (2 * 8); $font_size = 30; do { $font_size--; $right_text = $bbox[2]; $left_text = $bbox[0]; $width_text = $right_text - $left_text; } while ( $font_size>8 && ( $height_text>$height_image_wo_margin || $width_text>$width_image_wo_margin ) ); if ( $height_text>$height_image_wo_margin || $width_text>$width_image_wo_margin ) { echo "Disculpe Su Texto Es Muy Grande.<br>"; } else { $text_x = $width_image/2.0 - $width_text/2.0; $text_y = $height_image/2.0 - $height_text/2.0 ; if ($left_text < 0) $text_y += $above_line_text; $text_y -= 2; $button_text); } } ?> <body> <form id="form1" name="form1" method="post" action="verifica.php"> <p> <input type="text" name="verificar" id="verificar" /> <img src="?img" width="100" height="30" /></p> <p> <input type="submit" name="button" id="button" value="Enviar" /></p> </form> </body>
verifica.php
Código php:
Ver original
<?php if ($_POST['verificar'] == $_SESSION['captcha']){ echo 'Paso La Prueba De Verificación'; } else { echo 'La Letras Ingresadas No coinsiden con la imagen'; } ?>
si tiene sugerencias =D