这是我的HTML
<input type="text" class="form-control" name="email" placeholder="<?php echo lang('email'); ?>" value="<?php echo $this->input->post('email') ? set_value('email') : $profile['email']; ?>">
当我提交表单然后控制器处理数据如
$user = array(
'email' => trim($this->input->post('email', TRUE)),
'username' => trim($this->input->post('username', TRUE)),
'password' => md5($this->input->post('password', TRUE)),
'email' => trim($this->input->post('mobile', TRUE))
);
现在var_dump(trim($this->input->post('email', TRUE)));return;
此输出为(var_dump()result)
string 'rejoan.er@gmail.com' (length=19)
但是数组不能与SAME DATA一起使用SAME FORM。当var_dump($user)
然后email
字段数据未收到时。它显示如下
array (size=3)
'email' => string '' (length=0)
'username' => string 'rejoan' (length=6)
'password' => string 'd41d8cd98f00b204e9800998ecf8427e' (length=32)
我在这里做错了什么???
答案 0 :(得分:1)
上的小错误
$user = array(
'email' => trim($this->input->post('email', TRUE)),
'username' => trim($this->input->post('username', TRUE)),
'password' => md5($this->input->post('password', TRUE)),
'email' => trim($this->input->post('mobile', TRUE)) <==== Error is in here
);
将第二个'email'
更改为'mobile'