The CI button submits a question about the connection path of the action expressed in the query database.

Source: Internet
Author: User
Tags php foreach
CI button submit expression query database expression action connection path problem I just started learning CI, today is a small program, the process of the program is text box input student name, click the button and click submit to query the score of the student in the database.

The problem now is that I have no problem during local testing, but after uploading to the server, the error is displayed as follows:

404 Page Not Found

The page you requested was not found.

I think the address submitted by action is incorrect. could you please help me solve it? thank you.


My form is written in this way.
    



My model code is
Class Getdb_model extends CI_Model {public function getresult () {/* combine the SQL statement * // * $ cname = $ this-> input-> post ('cname '); $ cert = $ this-> input-> post ('ccert '); print_r ($ cname); print_r ($ cert ); */$ cname = $ this-> input-> post ('cname'); $ cert = $ this-> input-> post ('ccert '); $ cname_item = 'username'; $ data = $ this-> db-> where (array ('username' => $ cname)-> get ('exam _ resu ') -> result_array (); return $ data ;}}




My controller model is

 Load-> model ('getdb _ model', 'Get'); $ data ['CJ '] = $ this-> get-> getresult (); /* call another view */$ this-> load-> view ('result', $ data );}}



The code for the view that displays the final result is

 
 
Student Name Admission Ticket No. Multiple choice questions Multiple choice questions Blank question Illustration Short answer Calculation questions Test questions Total score


Reply to discussion (solution)



I can't change it like this, but it works when I test 172.0.0.1 locally.
Is it a session problem?

I am a newbie, don't understand. please answer. thank you.



After the output, is the action address correct? If it is correct, do you use urlrewrite? Whether the urlrewrite on the server is configured correctly



After the output, is the action address correct? If it is correct, do you use urlrewrite? Whether the urlrewrite on the server is configured correctly



The output address is correct, but my server is an Alibaba Cloud light ECS server. so I don't know which one to modify and how to modify it?

Thank you.



After the output, is the action address correct? If it is correct, do you use urlrewrite? Whether the urlrewrite on the server is configured correctly




My uploaded server address is: www.webside.com/html/cxcj/index.php/getresult/index

Correct. how can I set urlrewrite?

Do not use a domain name. you only need a path! The domain name browser will add it.

 

Do not use a domain name. you only need a path! The domain name browser will add it.

 



Whether it's not on your own or I fill it out completely, it's 404 Page.


404 Page Not Found

The page you requested was not found.


Will it be a server problem ??~


I have no problem with the local test, but it is always on the server page not found. please answer why ~

Thank you. after you click the button, the action is 404.

I have solved the problem of powder dispersion.

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.