<form action ="jz.php" method ="post">
<br><input type ="checkbox" name ="cumtom" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom" value="hat"> 帽子
<br><input type ="submit" value="确认">你这里就已经是冲突了。解决方法是:<form action ="jz.php" method ="post">
<br><input type ="checkbox" name ="cumtom[]" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom[]" value="hat"> 帽子
<br><input type ="submit" value="确认">
以后这类内容,自己先多加几个测试点测试看看,再来问。
<br><input type ="checkbox" name ="cumtom" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom" value="hat"> 帽子
<br><input type ="submit" value="确认">你这里就已经是冲突了。解决方法是:<form action ="jz.php" method ="post">
<br><input type ="checkbox" name ="cumtom[]" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom[]" value="hat"> 帽子
<br><input type ="submit" value="确认">
以后这类内容,自己先多加几个测试点测试看看,再来问。
解决方案 »
- 正则去除一些DIV内的内容。
- 没分了,以后还大家,先帮我解决问题
- 请问如何通过GET方式来获取MYSQL数据?
- 我想制作一个股票网站,大家帮我想想点子。送分了!!!!
- mysql 插入数据时中文变\x87\xE7\xA7\x91\xE7\x82这种?
- Notice: mysql_connect(): SQL safe mode in effect - ignoring host/user/password information in E:\php\chinaTaiWaiSeerver\dgtsfron
- 如何将mysql的数据转换到sqlserver呢?非常感谢!
- cookie
- PHP 无法采集部分图片(不仅限于使用CURL方法)
- $_SERVER["SERVER_PORT"]获取端口的问题
- 初学php,一个小菜问题~~~~~~~~~~~~
- mysql 中替换字母以外的字符,用什么??
<input type ="checkbox" name ="cumtom[]" value="hat">$post = $_POST["cumtom"];
$list = "";
for( $i=0; $i<count($post); $i++ )
{
$list .= $post[$i];
}
$_SESSION["buylist"];
....
<br><input type ="checkbox" name ="cumtom" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom" value="hat"> 帽子
改为
<br><input type ="checkbox" name ="cumtom[]" value="book"> 入门手册
<br><input type ="checkbox" name ="cumtom[]" value="hat"> 帽子2、
if ($_POST['cumtom']=="book") {
$_SESSION['buylist'].=";book;";
}
if ($_POST['cumtom']=="hat") {
$_SESSION['buylist'].="hat;";
}$temp = $_SESSION['buylist'];
$result =split(";",$temp);改为
if ($_POST['cumtom']) {
foreach($_POST['cumtom'] as $v) {
$_SESSION['buylist'][] = $v;
}
$result = $_SESSION['buylist'];
}
<?
if (isset($_POST['book'])) {
$buylist[]="book";
}
elseif (isset($_POST['hat'])) {
$buylist[]="hat";
}
elseif (isset($_POST['shoes'])) {
$buylist[]="shoes";
}$num = count ($buylist); for ($i=0;$i<$num;$i++)
printf ("你买的商品".$buylist[$i]);print_r ($buylist);?>gm
<?
$_SESSION['name']="";
$_SESSION['buylist']="";
?><form action ="jz.php" method ="post">
<br><input type ="checkbox" name ="book" value="book"> 入门手册
<br><input type ="checkbox" name ="hat" value="hat"> 帽子
<br><input type ="checkbox" name ="shoes" value="hat">鞋子
<br><input type ="submit" value="确认">