|
发表于 2009-11-28 11:34:19
|
显示全部楼层
其实那个很简单的,不过我也弄了还一会!:)
只要把代码改成下面这样就可乐:
控制器:show.php
<?
session_start();
class show extends Controller{
function __construct()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('getcode');
}
function d(){
$this->load->view('aa');
//echo "<img src=/scode.gif ><form method='post' action='ck'><input name='ccd'><input type='submit'></form>";
}
function scode(){
getcode();
}
function ck(){
$str=$_POST['ccd'];
if($str == $_SESSION['authcode']){
echo 'ok!';
}else{
echo 'wrong';
}
}
}
?>
试图:aa.php
<form action="<?php echo site_url('show/ck');?>" method="post" action="ck">
<input type="text" name="ccd" value=""><img alt="" src="<?php echo site_url('show/scode');?>" >
<input type='submit'>
</form>
还有一点就是把getcode_helper里面的session_start()注释就行了:) |
|