Home  >  Article  >  Backend Development  >  $_SESSION输出有关问题

$_SESSION输出有关问题

WBOY
WBOYOriginal
2016-06-13 12:09:08825browse

$_SESSION输出问题
生成验证码时候生成随机4个数,放在数组$_SESSION['code']里面,验证码图片$_SESSION输出有关问题,然后我紧跟在$_SESSION输出有关问题这条代码后面,添加了一条echo $_SESSION['code'],但是显示出来的和验证码图片不一致,比生成的验证码图片要慢一拍,也就是输出的验证码是刷新前的验证码图片上的数字,求大神指点
------解决思路----------------------
表单产生时的执行顺序
echo '$_SESSION输出有关问题';
echo $_SESSION['code'];

$_SESSION输出有关问题 要加载到浏览器才会执行

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn