代码点火器:此页面无法正常工作 localhost 当前无法处理此请求.HTTP 错误 500



我正在做一件简单的事情,将一些内容保存在数据库中,但有些事情是我如何得到这个HTTP错误500的。 我不知道为什么它会来,我的代码也无法正常工作。请看一看

Controller.php
function register_query()
{
//load the registration helper under helper folder
$this->load->helper('registration');

$this->form_validation->set_rules('first_name', 'Name', 'required');
$this->form_validation->set_rules('message1', 'Message', 'required');
$this->form_validation->set_rules('email', 'Email Address', 'required');
if ($this->form_validation->run() == true)
{
$data = array(
'first_name' => $this->input->post('first_name'),
'message1' => $this->input->post('message1'),
'email' => $this->input->post('email'),
);
}
if ($this->form_validation->run() == true && $this->Register_Model->register_query($data))
{ 
$data['success'] = "Your Query has been sent successfully... !!";
$this->load->view('contact',$data);
}
else
{
$data['success'] = "Your Query has not been sent successfully... !!";
$this->load->view('contact',$data);
}
}
Model.php
public function query($data)
{
$this->db->insert('queries', $data);
$id = $this->db->insert_id();
return (isset($id)) ? $id : FALSE;      
}

您需要向我们提供更多信息,只需 500 响应代码。 检查您的错误日志,并更新您的问题。

为了获得最佳错误日志记录体验,请将error_reporting设置为 -1,关闭display_errors,然后设置自定义error_log。然后在终端中,键入tail -f /path/to/error_log。您的通知、警告和错误现在将实时滚动过去,而不会扭曲网页的显示。

快速方法是将ini_set('display_errors', 'On');放在脚本的顶部。

相关内容

最新更新