表单部分
: 代码如下:
PHP 处理部分
: 代码如下:
PHP
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 "";
}
break; case "null":
$null_sql = "delete from `cartemp` where username='$username' and flag=0 ";
MysqL_query($null_sql,$conn);
echo "";
break;
case "del":
$id = $_GET['id'];
$del_sql = "delete from `cartemp` where id=$id";
MysqL_query($del_sql,$conn);
echo "";
break;
}
?>
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 "";
}
break; case "null":
$null_sql = "delete from `cartemp` where username='$username' and flag=0 ";
MysqL_query($null_sql,$conn);
echo "";
break;
case "del":
$id = $_GET['id'];
$del_sql = "delete from `cartemp` where id=$id";
MysqL_query($del_sql,$conn);
echo "";
break;
}
?>