我是 codeigniter 的新手。但现在我正在使用 codeigniter 开发一个项目。我的 HTML 代码是这样的:
<input type="text" class="get_started_frm_reg" name="first_name" required />
Run Code Online (Sandbox Code Playgroud)
现在我想通过函数 form_input() 函数来转换它。我写了这样的代码
$first_name=array(
"name"=>"first_name",
"class"=>"get_started_frm_reg",
"type"=>"text"
);
Run Code Online (Sandbox Code Playgroud)
但我不明白如何输入必填字段。请帮助我。
我想在db中插入值.我有一个表作为registration_patients.我的代码是:
$data = array(
'patients_first_name' => $this->input->post('first_name'),
'patients_last_name' => $this->input->post('last_name'),
'patients_email' => $this->input->post('email'),
'patients_password'=> $this->input->post('password'),
'patients_birth_date'=> date('Y-m-d', strtotime($this->input->post('day') . "-" .$this->input->post('month') . "-" . $this->input->post('year'))),
'patients_sex'=> $this->input->post('sex'),
'patients_telephone'=> $this->input->post('telephone'),
'patients_codice_fiscale'=> $this->input->post('codice_fiscale'),
'account_active'=> 0
);
return $this->db->insert('registration_patients', $data);
Run Code Online (Sandbox Code Playgroud)
现在它将值插入数据库总线,显示一些错误和警告
遇到PHP错误
严重性:警告
消息:strtotime():依赖系统的时区设置是不安全的.您需要使用date.timezone设置或date_default_timezone_set()函数.如果您使用了这些方法中的任何一种并且仍然收到此警告,则很可能拼错了时区标识符.我们选择"欧洲/伦敦"代替"BST/1.0/DST"
文件名:models/doctors_model.php
行号:22遇到PHP错误
严重性:警告
消息:date():依赖系统的时区设置是不安全的.您需要使用date.timezone设置或date_default_timezone_set()函数.如果您使用了这些方法中的任何一种并且仍然收到此警告,则很可能拼错了时区标识符.我们选择"欧洲/伦敦"代替"BST/1.0/DST"
文件名:models/doctors_model.php
行号:22