Jump to content

In this script captcha image isn't displaying pls guide me to find the problem.


syedkhajafairoz
 Share

Recommended Posts

//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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...