zonglonglong

使用验证码的时候,一开始正常,后来不显示了

网上说是utf-8的编码问题,什么bom去掉,转化为无bom的格式

 

我都试了,没用

后来知道是在调用验证码的地方  写上


Public function verify(){
import(\'ORG.Util.Image\');
Image::buildImageVerify();
}
改成这样就行了
Public function verify(){
import(\'ORG.Util.Image\');
ob_clean();//这个就是关键
Image::buildImageVerify();
}

 

ob_clean这个函数的作用就是用来丢弃输出缓冲区中的内容,如果你的网站有许多生成的图片类文件,那么想要访问正确,就要经常清除缓冲区。

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-06-15
  • 2022-12-23
  • 2021-11-29
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2021-11-29
  • 2021-11-29
  • 2021-08-06
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
相关资源
相似解决方案