Tutorial Address (http://codeigniter.org.cn/user_guide/tutorial/create_news_items.html)
Why do I click the Create news item URL to become
Http://test.com/index.php/news/test.com/index.php/news/create? Then show 404
public function create(){ $this->load->helper('form'); $this->load->library('form_validation'); $data['title'] = 'Create a news item'; $this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('text', 'text', 'required'); if ($this->form_validation->run() === FALSE) { $this->load->view('templates/header', $data); $this->load->view('news/create'); $this->load->view('templates/footer'); } else { $this->news_model->set_news(); $this->load->view('news/success'); }}
I've copied this code all the time.
As normal, he's going to run the else part, but I don't know why it's not working.
And that URL is weird too.
If his if judgment statement should also be the load that view template, that is the original page it?
Why does he append a URL directly after the URL?
Setting $config[' Base_url ' to NULL in config/config.php has been resolved.
Reply content:
Tutorial Address (http://codeigniter.org.cn/user_guide/tutorial/create_news_items.html)
Why do I click the Create news item URL to become
Http://test.com/index.php/news/test.com/index.php/news/create? Then show 404
public function create(){ $this->load->helper('form'); $this->load->library('form_validation'); $data['title'] = 'Create a news item'; $this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('text', 'text', 'required'); if ($this->form_validation->run() === FALSE) { $this->load->view('templates/header', $data); $this->load->view('news/create'); $this->load->view('templates/footer'); } else { $this->news_model->set_news(); $this->load->view('news/success'); }}
I've copied this code all the time.
As normal, he's going to run the else part, but I don't know why it's not working.
And that URL is weird too.
If his if judgment statement should also be the load that view template, that is the original page it?
Why does he append a URL directly after the URL?
Setting $config[' Base_url ' to NULL in config/config.php has been resolved.
See if there's any redirect or anything in your code!