代码中写
public function verify(){
import('ORG.Util.Image');
ob_clean();
Image::buildImageVerify();
}
html中写
<img src='__APP__/Index/verify/'
onClick="this.src=this.src+'?'+Math.random()"
/>
<img src='__APP__/Index/verify/'
/>
就是说图片的路径就是上面php代码的访问路径,就ok
如果是图片不显示,就是ob_clean();没有写,这个方法就是去除缓存之类的
如果是乱码就是直接把上面的php代码写在了display方法的前面,记住,这个方法是单独的,不要和其他方法混在一起
破罐子互摔