Question about the CI button submit expression query database expression action connection path-php Tutorial

Source: Internet
Author: User
Tags php foreach
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.
 

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.