About the CI tutorial create page Insert Database problem

Source: Internet
Author: User
Tags codeigniter

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!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.