I just read a few tutorials about CAPTCHA from the net..I got the class captcha.php and a main file ..I pasted a few codes from the net but I cannot run the CAPTCHA as expected.The image is not being diaplayed....In stead I am getting the value from the alt in the image tag.
Here are my codes for the main file :
I tested the source of the image in the same directory as the captha.php and it works fine.
I will be highly obliged if anyone can help me in this ..Thanks
Here are my codes for the main file :
Code:
<?php session_start() ?>
<html>
<body>
<form method="post" action="">
<table bgcolor="#CCCCCC">
<tr><td><input type="text" name="validator" id="validator" size="4" />
<img src="captcha.php" alt="CAPTCHA image" align="top" /></td></tr>
<tr><th align="center"><input type="submit" value="Submit"></th></tr>
</table>
</form>
<?php
if(isset($_POST["captcha"]))
if (!empty($_POST['validator']) && $_POST['validator'] == $_SESSION['rand_code']) {
echo "Validated";
unset($_SESSION['rand_code']);
}
?>
</body>
</html>
I tested the source of the image in the same directory as the captha.php and it works fine.
I will be highly obliged if anyone can help me in this ..Thanks
Comment