关于中断程序并跳转的问题
本帖最后由 ekingluo 于 2011-9-30 15:31 编辑if ($new_pwd != $re_pwd){
set_ms('重复密码与新密码不相同!');
redirect($update_url,'location');
}
if ( ! $this->User_m->_valid_user_depart($depart) || ! $this->User_m->_valid_user_tel($tel) || ! $this->User_m->_valid_user_password($new_pwd)){
set_ms($this->User_m->_get_error());
redirect($update_url,'location');
}
if (! $this->User_m->_check_user($user_name, $old_pwd)){
set_ms('旧密码错误!');
redirect($update_url,'location');
以上代码在所有验证都不通过的时候,跳转过的页面显示的错误信息是“旧密码错误!”,也就是执行完第一个if后不会直接跳转到$update_url,还会继续执行下面的代码,我试过用PHP的header,和CI的set_header并且在后面加return,也不行。加exit当然就更不行了,有没有好的解决办法?
本帖最后由 ekingluo 于 2011-9-30 15:33 编辑
是我测试错了……以上代码没问题……正常 256269683 PHP CI框架 CodeIgnite交流群
页:
[1]