<?php
session_start();
require("mywebmanage/conn.php");
if($_SESSION[username]==""){
echo "<script>alert('请先登录,后购物!');history.back();</script>";
exit; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$_session['total'];
$arraygwc=explode("@",$_SESSION[producelist]);$s=0;
for($i=0;$i<count($arraygwc);$i++){
$s+=intval($arraygwc[$i]);
}
if($s==0){
echo "<tr>";
echo" <td colspan='5'>您的购物车为空!</td>";
echo"</tr>";
}
else
{
?>
<tr>
<td>数量</td>
<td>名称</td>
<td>价格</td>
<td>小计</td>
<td>操作</td>
</tr>
<?
$total=0;
$array=explode("@",$_SESSION[producelist]);
$arrayquatity=explode("@",$_SESSION[quatity]);while(list($name,$value)=each($_POST)){
for($i=0;$i<count($array)-1;$i++){ if(($array[$i])==$name)
{
$arrayquatity[$i]=$value;
}
}
$_SESSION[quatity]=implode("@",$arrayquatity);
//print_r($_SESSION[quatity]);
for($i=0;$i<count($array)-1;$i++){
$id=$array[$i];
$num=$arrayquatity[$i];
if($id!="")
{
$sql=mysql_query("select * from casee where news_id=$id");
$array=mysql_fetch_array($sql);
$total1=$num*$array[price];
$news_title=$array[news_title];
$total+=$total1;
$_SESSION["total"]=$total;
?>
<tr>
<td> </td>
<td><? echo $news_title;?></td>
<td><? echo $array['price'];?></td>
<td><? echo $total;?></td>
<td>移除</td>
</tr>
<?php
}
}
}
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php
}
?>
为什么在红的那一行就不执行了?为什么会条件不满足???求高手解答
session_start();
require("mywebmanage/conn.php");
if($_SESSION[username]==""){
echo "<script>alert('请先登录,后购物!');history.back();</script>";
exit; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$_session['total'];
$arraygwc=explode("@",$_SESSION[producelist]);$s=0;
for($i=0;$i<count($arraygwc);$i++){
$s+=intval($arraygwc[$i]);
}
if($s==0){
echo "<tr>";
echo" <td colspan='5'>您的购物车为空!</td>";
echo"</tr>";
}
else
{
?>
<tr>
<td>数量</td>
<td>名称</td>
<td>价格</td>
<td>小计</td>
<td>操作</td>
</tr>
<?
$total=0;
$array=explode("@",$_SESSION[producelist]);
$arrayquatity=explode("@",$_SESSION[quatity]);while(list($name,$value)=each($_POST)){
for($i=0;$i<count($array)-1;$i++){ if(($array[$i])==$name)
{
$arrayquatity[$i]=$value;
}
}
$_SESSION[quatity]=implode("@",$arrayquatity);
//print_r($_SESSION[quatity]);
for($i=0;$i<count($array)-1;$i++){
$id=$array[$i];
$num=$arrayquatity[$i];
if($id!="")
{
$sql=mysql_query("select * from casee where news_id=$id");
$array=mysql_fetch_array($sql);
$total1=$num*$array[price];
$news_title=$array[news_title];
$total+=$total1;
$_SESSION["total"]=$total;
?>
<tr>
<td> </td>
<td><? echo $news_title;?></td>
<td><? echo $array['price'];?></td>
<td><? echo $total;?></td>
<td>移除</td>
</tr>
<?php
}
}
}
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php
}
?>
为什么在红的那一行就不执行了?为什么会条件不满足???求高手解答
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货