PHP updates the number of shopping carts (PHP processing in the form part ). Form part: the Copy code is as follows: formaction? Actionedit_nummethodpostnamecar? Php $ c_rs [id];? Id];? Inputnamesuliang [? Phpecho $ c_rs
Form part:
The code is as follows:
PHP processing:
The code is as follows:
Require 'config. inc. php ';
Require 'checklogin. php ';
$ Username = $ _ SESSION ['username'];
$ Action = $ _ GET ['action'];
Switch ($ action ){
Case "edit_num ":
$ Arr = $ arr =$ _ POST ['suliang '];
Foreach ($ arr as $ key => $ value ){
$ Sqlgx = "update 'cartemp 'set suliang =' $ value' where username = '". $ username. "'and flag = 0 and sp_id = '". $ key. "'";
Mysql_query ($ sqlgx, $ conn );
Echo "script location. href = 'shopcat. php' script";
}
Break;
Case "null ":
$ Null_ SQL = "delete from 'cartemp 'where username =' $ username' and flag = 0 ";
Mysql_query ($ null_ SQL, $ conn );
Echo "script location. href = 'shopcat. php' script";
Break;
Case "del ":
$ Id = $ _ GET ['id'];
$ Del_ SQL = "delete from 'cartemp 'where id = $ id ";
Mysql_query ($ del_ SQL, $ conn );
Echo "script location. href = 'shopcat. php' script";
Break;
}
?>
Authorization: the code is as follows: form action = "? Action = edit_num "method =" post "name =" car? Php $ c_rs ['id'];? "Id =" car? Php $ c_rs ['id'];? "Input name =" suliang [? Php echo $ c_rs...