|
本帖最后由 hellblog 于 2010-3-13 20:23 编辑
Fatal error: Call to undefined method MContacts::addContact() in E:\php_study\ci\system\application\controllers\welcome.php on line 20
PHP复制代码
function contactus(){
$this->load->helper('url');
$this->load->model('MContacts','',TRUE);
$this->MContacts->addContact();
redirect('welcome/thankyou','refresh');
}
复制代码
模型页 PHP复制代码
class MContacts extends Model {
function MContacts (){
parent ::Model();
}
}
function addContact (){
$now = date("Y-m-d H:i:s");
$data = array(
'name' => $this->input->xss_clean($this->input->post('name')),
'email' => $this->input->xss_clean($this->input->post('email')),
'notes' => $this->input->xss_clean($this->input->post('notes')),
'ipaddress' => $this->input->ip_address(),
'stamp' => $now);
$this->db->insert('contacts', $data);
} 复制代码 |
|