for($i=0;$i<count($array)-1;$i++)
{
$id=$array[$i];
$num=$arrayquatity[$i];
if($id!="")
{
$sql=mysql_query("select * from shangpin where",$conn);
$info=mysql_fetch_array($sql);
$total1=$num*$info[huiyuanjia];
$total+=$total1;
$_SESSION["total"]=$total;
?>
<tr>
<td bgcolor="#FFFFFF"><div><?php echo $info[mingcheng];?></div></td>
<td bgcolor="#FFFFFF"><div>
<input type="text" size="2" value=https://www.jb51.net/<?php echo $num;?>>
</div></td>
<td bgcolor="#FFFFFF"><div><?php echo $info[shichangjia];?>元</div></td>
<td bgcolor="#FFFFFF"><div><?php echo $info[huiyuanjia];?>元</div></td>
<td bgcolor="#FFFFFF"><div><?php echo @(ceil(($info[huiyuanjia]/$info[shichangjia])*100))."%";?></div></td>
<td bgcolor="#FFFFFF"><div><?php echo $info[huiyuanjia]*$num."元";?></div></td>
<td bgcolor="#FFFFFF"><div><a href="removegwc.php?id=https://www.jb51.net/<?php echo $info[id]?>">移除</a></div></td>
</tr>
<?php
}
}
?>
<tr>
<td colspan="8" bgcolor="#FFFFFF"><div>
<table cellpadding="0" cellspacing="0">
<tr>
<td><div>
<input type="submit" value="更改商品数量">
</div></td>
<td><div><a href="https://www.jb51.net/gouwu2.php">去收银台</a></div></td>
<td><div><a href="https://www.jb51.net/gouwu1.php?qk=yes">清空购物车</a></div></td>
<td><div>总计:<?php echo $total;?></div></td>
</tr>
</table>
</div></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</form>
</table></td>
</tr>
</table>
3、文件gouwu2.php
复制代码 代码如下: