This program is always unable to submit data in the generated interface. it always prompts that the information with the asterisk is not complete, but I have already completed it.

Source: Internet
Author: User
This program is always unable to submit data in the generated interface, and always prompts that the information with the asterisk is not complete, however, I have already completed this post and finally edited it by jackbill43 at 2013-08-1515: 09: 41 ;! DOCTYPE & nbsp; HTML & gt; & lt; html & gt; & lt; HEAD this program is always unable to submit data on the generated interface, the system always prompts that the information with the asterisk is not complete, but I have already completed it.
This post was finally edited by jackbill43 at 15:09:41.




Classroom addition/modification



Include_once ("base-class.php ");

// Create an sae database class
$ Mysql = new SaeMysql ();

// Obtain the classroom ID to be modified and input it
$ Class_id = intval ($ _ GET ["class_id"]);

// Obtain the Operation ID for input
$ Action = $ _ POST ["action"];
$ Action = string: un_script_code ($ action );
$ Action = string: un_html ($ action );

// Determine whether to modify the content. if the classroom ID is input, query the database to obtain all the content.
If ($ class_id)
{
$ Class_value = $ mysql-> getLine ("select * from class where class_id = $ class_id ");
If (! $ Class_value)
{
Echo "script alert ('none classroom '); history. back ();";
Exit;
}
}

// If the operation ID is obtained, enter or modify the operation ID.
If ($ action = "update ")
{
// Obtain the input data of the form
$ Old_class_id = $ _ POST ["class_id"];
$ Class_name = $ _ POST ["class_name"];
$ Class_number = $ _ POST ["class_number"];
$ Class_fid = $ _ POST ["class_fid"];
$ Class_status = $ _ POST ["class_status"];

// Filter incoming data
$ Old_class_id = intval ($ old_class_id );
$ Class_name = string: un_script_code ($ class_name );
$ Class_number = string: un_script_code ($ class_number );
$ Class_fid = intval ($ class_fid );
$ Class_status = intval ($ class_status );

// Check Required items
If (! $ Class_name |! $ Class_number |! $ Roster_status)
{
Echo "script" alert ('The form is not complete, and an asterisk is required! '); History. back ();";
Exit;
}



// Default parameter
$ Nowtime = date ("Y/m/d H: I: s", time ());
// If it is modified
If ($ old_class_id)
{
 
$ SQL = "update class set
Class_name = '$ class_name ',
Class_number = '$ class_number ',
Class_fid = '$ class_fid ',
Class_status = '$ class_status ',
Edittime = '$ nowtime'
Where class_id = $ old_class_id ";

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.