用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2100|回复: 1
收起左侧

[HELP] 新手,关于url的问题!/yzm.php和/yzm

[复制链接]
发表于 2013-8-2 15:34:32 | 显示全部楼层 |阅读模式
写了个验证码yzm.php。
<?php
session_start();
header('content-type:image/gif;');
for($_i=0;$_i<4;$_i++){
    $_code.=dechex(mt_rand(0,15));
}
$_SESSION['code']=$_code;
$_img=imagecreatetruecolor(50,26);
$_blue=imagecolorallocate($_img,20,66,111);
imagefill($_img,0,0,$_blue);
$_white=imagecolorallocate($_img,255,255,255);
imagestring($_img,8,6,6,$_SESSION['code'],$_white);
imagegif($_img);
imagedestroy($_img);
?>
在本地用/yzm.php掉用不了,把这个写成控制器里方法/yzm就能用!
但在上传到服务器上可用/yzm.php?xxxxxxx,是不是本地的服务器没配置好?新手请教!

发表于 2013-8-5 17:34:23 | 显示全部楼层
你已经自己写了一个验证码生成器了,确保你没有rewrite,其次,你跳过入口直接使用自己的方法,基本上CI就用不上了。

本版积分规则