The CI button submits a question about the action connection path in the query database. This post was last edited by huaipiqi_net in 2015-05-2713: 08: 10. I just started to learn CI, today, I am working on a small program. The procedure is to enter the student name in the & nbsp; text box, after clicking the button to submit, the question is how many scores this student has scored in the database. now, when I perform a local test, the question is that the CI button submits a question about the action connection path expressed in the database.
This post was last edited by huaipiqi_net at 13:08:10
I just started to learn CI. today I am working on a small program. the procedure is to enter the student name in the text box and click submit to query the student scores 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 SQL statements here */
/* $ 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
Defined ('basepath') OR exit ('no direct script access allowed ');
Class Getresult extends CI_Controller {
Public function index ()
{
$ This-> 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 |
|
|
|
|
|
|
|
|
|
|
------ Solution ----------------------
------ Solution ----------------------
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
------ Solution ----------------------
Do not use a domain name. you only need a path! The domain name browser will add it.