猫咪兔 2012-02-23 09:44:01 4130次浏览 2条回复 0 0 0
$model=new Member('foget');
if(isset($_POST['Member']))
{
    $model->attributes=$_POST['Member'];						
    $user=Member::model()->find('email=?',array($model->email));			
    if($user===null)
    {
        Yii::app()->user->setFlash('foget','没有该用户请重新输入');
        $this->refresh();
    }
    else
    {
        $npassword=rand(100000,999999);//产生一个随机密码
        $newpassword=md5($user->salt.$npassword); 
        $user->userpassword=$newpassword;//userpassword 是数据库字段名,
        return $user->save();
    }
}

返回为false; 请教 哪出错了吗?怎么保存不了呢?

  • 回复于 2012-02-23 10:28 举报

    保存的时候用$user->save(false); 数据库里的值已经能改了,可是浏览器却报错了……

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email]admin@example.com[/email] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    

    报这个错误,这又是什么原因呢?
    另 我的规则里是针对这个页面是什么也没写的

  • 回复于 2012-03-14 12:31 举报

    用try catch一下那个save的error看看有没有,另外这个错误也不太对吧,500错误是apache的问题啊,看下apache的log

您需要登录后才可以回复。登录 | 立即注册