Tutorial address (codeigniter.org.cnuser_guidetutorialcreate_news_items.html) Why do I click CreatenewsitemURL to change to test. comindex. phpnewstest. comindex. phpnewscreate? Then display 404 {generation...
Tutorial address (http://codeigniter.org.cn/user_guide/tutorial/create_news_items.html)
Why is the URL changed when I click Create news item?
Http://test.com/index.php/news/test.com/index.php/news/create? Then display 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 copied this code.
Normally, he needs to run the else part, but he does not know why he cannot run it.
The URL is also very strange.
If his if judgment statement is set up, it should also be the load view template, that is, the original page, right?
Why does it append a URL directly after the URL?
In config/config. php, set $ config ['base _ url'] to null.
Reply content:
Tutorial address (http://codeigniter.org.cn/user_guide/tutorial/create_news_items.html)
Why is the URL changed when I click Create news item?
Http://test.com/index.php/news/test.com/index.php/news/create? Then display 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 copied this code.
Normally, he needs to run the else part, but he does not know why he cannot run it.
The URL is also very strange.
If his if judgment statement is set up, it should also be the load view template, that is, the original page, right?
Why does it append a URL directly after the URL?
In config/config. php, set $ config ['base _ url'] to null.
Check whether there is anything like redirection in your code!