• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to fix this error?

#1
[eluser]chmod[/eluser]
controller:

Code:
function ilogin(){
         $username = $this->input->post('input_username');
         $password = $this->input->post('input_password');
         $sig_key = $this->input->post('sig_key');

        //将表名存入session中
        $tablename = $this->security_model->getMemberTableName($username);
        $session_data = array('tablename' => $tablename);
        $this->session->set_userdata($session_data);

         $this->form_validation->set_rules('input_username','lang:label_username','trim|xss_clean|required|callback_checkUserPass');
        $this->form_validation->set_rules('input_password','lang:label_password','trim|xss_clean|required');
        $this->form_validation->set_rules('sig_key', 'lang:sig_key', 'callback_checkSigKey');

        if ($this->form_validation->run() === FALSE){
             $data = array('title' => $this->lang->line('page_title_login'));
             $this->load->view('center/login_main_tpl', $data);
        }else{
            $pid = $this->security_model->getUserPid($username)->pid;
            $md5password = $this->security_model->getUserPid($username)->md5Password;
            $nickname = $this->security_model->getIdByPid($username)->nickname;
            $exps = $this->security_model->getUserExps($username)->exps;
            $goldCoins = $this->security_model->getUserGoldCoins($username)->goldCoins;
            $credits = $this->security_model->getUserCredits($username)->credits;
            $ranks = $this->security_model->getUserRanks( $exps );
            $payType = $this->security_model->getUserPayType($username)->payTypeName;
            $groupId = $this->security_model->getIdByPid($username)->groupId;

            $session_data = array(    'session_id_saved' => $this->session->userdata('session_id'),
                                    'username' => $username,
                                    'pid' => $pid,
                                    'md5password' => $md5password,
                                    'nickname' => $nickname,
                                    'exps' => $exps,
                                    'goldCoins' => $goldCoins,
                                    'credits' => $credits,
                                    'ranks' => $ranks,
                                    'payType' => $payType,
                                    'groupId' => $groupId);
            $this->session->set_userdata($session_data);

            $forward = $this->session->userdata('forward');
            if (!empty($forward)){
                redirect($forward, 'refresh');
            }else{
                $username = $this->session->userdata('username');
                $data = array(    'username' => $this->session->userdata('username'),
                                'nickname' => $nickname,
                                'credits' => $credits,
                                'ranks' => $ranks,
                                'goldCoins' => $goldCoins,
                                'serviceStartTime' => $this->security_model->getIdByPid($username)->serviceStartTime,
                                'serviceEndTime' => $this->security_model->getIdByPid($username)->serviceEndTime,
                                'totalFillTimes' => $this->security_model->getIdByPid($username)->totalFillTimes,
                                'payType' => $payType);
                $this->load->view('center/mycenter_tpl',$data);
            }
        }
     }

when I submit username and password,but empty sigKey,
the CI noted me following error message:
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: 4096</p>
<p>Message: Object of class CI_DB_mysql_result could not be converted to string</p>
<p>Filename: libraries/Form_validation.php</p>
<p>Line Number: 1205</p>

</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message: Object of class CI_DB_mysql_result to string conversion</p>
<p>Filename: libraries/Form_validation.php</p>
<p>Line Number: 1205</p>

how can i fix these error?


Messages In This Thread
how to fix this error? - by El Forum - 07-06-2009, 04:08 AM
how to fix this error? - by El Forum - 07-06-2009, 04:28 AM
how to fix this error? - by El Forum - 07-06-2009, 06:32 AM
how to fix this error? - by El Forum - 07-06-2009, 07:12 AM
how to fix this error? - by El Forum - 07-06-2009, 07:35 AM
how to fix this error? - by El Forum - 07-06-2009, 07:50 AM
how to fix this error? - by El Forum - 07-06-2009, 08:27 AM
how to fix this error? - by El Forum - 07-06-2009, 08:49 AM
how to fix this error? - by El Forum - 07-06-2009, 09:03 PM
how to fix this error? - by El Forum - 07-07-2009, 06:55 AM
how to fix this error? - by El Forum - 07-07-2009, 08:38 AM
how to fix this error? - by El Forum - 07-07-2009, 10:28 AM
how to fix this error? - by El Forum - 07-07-2009, 09:14 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.