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.