syedkhajafairoz Posted January 28, 2012 Share Posted January 28, 2012 //captcha.php script <?phpsession_start();$text = rand(10000,99999);$_SESSION["vercode"] = $text;$height = 25;$width = 65; $image_p = imagecreate($width, $height);$black = imagecolorallocate($image_p, 0, 0, 0);$white = imagecolorallocate($image_p, 255, 255, 255);$font_size = 14; imagestring($image_p, $font_size, 5, 5, $text, $white);imagejpeg($image_p, null, 80);?> //html form script <body><form id="form1" name="form1" method="post" action=""><table width="500" border="0"><tr><td>Verify Code </td><td><img src="captcha.php" /></td><td><input type="text" name="verifycode" /></td></tr><tr><td colspan="3"><input type="submit" name="submit" value="submit" /></td></tr></table></form></body> Link to comment Share on other sites More sharing options...
birbal Posted January 28, 2012 Share Posted January 28, 2012 you need to set proper ontent type header before any ouput is produed to browserheader("Content-type:image/jpg"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.