您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP验证码图案无法显示

2025/6/27 18:45:18发布10次查看
下面captcha.php文件运行时回报500错误, 不显示验证码图案
注掉这句$_session['pass_phrase'] = sha($pass_phrase); 后,就不报错并且可以显示图案了,什么原因呢?
需要session保存信息要如何修改?
回复讨论(解决方案) 把这句header('content-type: image/png');拿到最前面。
将header注释掉运行看报什么错误
把这句header('content-type: image/png');拿到最前面还是报500, 且firefox提示:
图像http://localhost/captcha.php因其本身有问题无法显示
没拿到最前面时没这个提示
另外,拿到前面后,如果注掉这句$_session['pass_phrase'] = sha($pass_phrase); ,还是可以显示的
注掉header还是报500:
get captcha.php
500 internal server error
localhost
0 b
127.0.0.1:80
响应头信息原始头信息
cache-control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
connection close
content-length 0
content-type text/html
date sun, 03 nov 2013 12:16:16 gmt
expires thu, 19 nov 1981 08:52:00 gmt
pragma no-cache
server apache/2.2.25 (win32) php/5.3.27
x-powered-by php/5.3.27
请求头信息原始头信息
accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-encoding gzip, deflate
accept-language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
cache-control max-age=0
connection keep-alive
cookie phpsessid=9e4i75adp4ahnpba6ieq1pinn0
host localhost
user-agent mozilla/5.0 (windows nt 6.3; wow64; rv:24.0) gecko/20100101 firefox/24.0
$_session['pass_phrase'] = sha($pass_phrase); 
改成:
$_session['pass_phrase'] = sha1($pass_phrase);
呢? 
,sha()是mysql的函数来着,php的是sha1,谢谢,给分
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product