我的CodeIgniter项目在localhost上运行良好,但是当我将它上传到实时服务器上时会产生一些错误:
错误:“意外T_CONSTANT_ENCAPSED_STRING”
在这部分代码中:
$username = $this->input->post('username');
$email = $this->input->post('email');
$password = $this->input->post('password'); $flag = 0;
$data = $this->user_model->Signup_user((
'username' => $username
'email' => $email
'password' => $password
'flag' => $flag
));
答案 0 :(得分:2)
应该是这样的:
$username = $this->input->post('username');
$email = $this->input->post('email');
$password = $this->input->post('password');
$flag = 0;
$data = $this->user_model->Signup_user(
array(
'username' => $username,
'email' => $email,
'password' => $password,
'flag' => $flag,
)
);
您需要传递包含所有值的数组,但是您使用了错误的语法。