English 中文(简体)
存在 cap和头盔问题
原标题:Having problems with captchas and headers (PHP)
  • 时间:2009-09-07 10:45:39
  •  标签:

I m trying to add a captcha to a site somebody else has made. I ve been following this tutorial and if I make it in a separate file, it works just fine (so it s not an issue with the server setup)

然而,当我试图在现有的一页上加一字时,它根本就没有工作。 当我装上因特网探索者网页时,源代码的外观特征是,图像本应展示出:

‰PNGIHDRé1°8ö[IDATxœÍ]kp×u>»X‹± (4  ›–9¦:‰-C£V™©4–[ÓL•4“Dm~„njR3ª]*qÒÚ‰£ŽãD–&~Ô±ØØŽ$

我收到以下信息: 不能展示“我的”形象,因为它含有错误。

我假定这一点与头脑有关,但我并不真正相信。

这是用来制造形象的Im法:

$md5 = md5(microtime() * mktime());
$string = substr($md5,0,5);
$captcha = imagecreatefrompng("./captcha.png");
$black = imagecolorallocate($captcha, 0, 0, 0);
$line = imagecolorallocate($captcha,233,239,239);
imageline($captcha,0,0,39,29,$line);
imageline($captcha,40,0,64,29,$line);
imagestring($captcha, 5, 20, 10, $string, $black);
$_SESSION[ key ] = md5($string);
header("Content-type: image/png");
imagepng($captcha);

任何建议都将受到高度赞赏。 感谢。

最佳回答

这些随机性质实际上是巴布亚新几内亚档案的内容。

正在发生的情况是,你将巴布亚新几内亚的数据重新输入了你的超文本档案,而不是将其与<代码><img>。

你们需要把该守则放在自己的档案中,并把它当作:

<img src="image.php">
问题回答

暂无回答




相关问题
热门标签