【发布时间】:2015-07-16 03:54:13
【问题描述】:
我正在研究 codeigniter。我试图在表单操作中调用控制器函数。
<form action="<?php echo site_url("Welcome/InsertValue");?>" method="post" name="frm1" >
这在本地服务器上完美运行。但在实时服务器中显示404 Page Not Found 错误。
这是我的控制器功能
function InsertValue(){
$this->load->database();
/*db(Insert)*/
$this->load->model("get_db");
$data = array(
'p_name' => $this->input->post('pname'),
'y_addr' => $this->input->post('addr'),
'rating' => $this->input->post('rating'),
'apartment' => $this->input->post('apartment'),
'web_url' => $this->input->post('website'),
'p_manage_qu' => $this->input->post('pcompany'),
'country' => $this->input->post('country'),
'city' => $this->input->post('city'),
'p_addr' => $this->input->post('paddr'),
'zip' => $this->input->post('zip'),
'contact' => $this->input->post('contact')
);
$this->get_db->insert1($data);
/*echo "new row added";*/
/*db(Insert)*/
$this->load->helper('url');
$this->load->view('supplier/property');
}
【问题讨论】:
-
请检查'Welcome/InsertValue'的大小写(小写/大写)。
-
试试
site_url("welcome/insertvalue") -
$this->load->helper('url'); - 确保这已经完成
-
您在显示 404 错误的 url 获得的链接
-
@ShaifulIslam 显示
404 Page Not Found错误
标签: php codeigniter