/ Published in: PHP
Expand |
Embed | Plain Text
<?php // safe this to a separate file image.php $image = imagecreate(40,16); imagecolorallocate($image, 255, 255, 255); imagecolorallocate($image, 0, 0, 0); imagestring($image, 5, 3, 0, " " . $letters[0] . " " . $letters[1], 1); imagestring($image, 5, 3, 0, $letters[2] . " " . $letters[3], 1); imagepng($image); // usage example: <img src="./image.php"/> <label>type in the code:</label> <input name="c" type="text"/> // validation example: } else { $captcha = false; } // handle POST vars here print "Thanks for your submission"; } ?>
You need to login to post a comment.
