Chinaunix首页 | 论坛 | 博客
  • 博客访问: 465206
  • 博文数量: 88
  • 博客积分: 1677
  • 博客等级: 上尉
  • 技术积分: 667
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-03 22:17
文章分类

全部博文(88)

文章存档

2013年(1)

2012年(18)

2011年(69)

分类: 系统运维

2011-11-10 09:21:01


               
                 
                 
                 
               
               
                 
                 
               
               
                 
                 
               
               
                 
                 
               
               
                 
                 
               
               
                 
                 
               
             

              if(trim($info[tupian]==""))
     {
       echo "暂无图片";
     }
     else
     {
      ?>
       
               }
      ?>
     
 
  【市场价:
  【会员价:
  查看信息
  放入购物车
  【剩余数量:
            if(($info[shuliang]-$info[cishu])>0)
      {
         echo ($info[shuliang]-$info[cishu]);
      }
      else
      {
         echo "已售完";
      }
      ?>】

           }
     ?>     

*********************************************addgouwuche.php**************************************
 
session_start();
include("conn.php");
 
if($_SESSION[username]=="")
 {
  echo "";  
  exit;
 }
  $id=strval($_GET[id]);
$sql=mysql_query("select * from shangpin where id='".$id."'",$conn);  
$info=mysql_fetch_array($sql);
if($info[shuliang]<=0)
 {
 
   echo "";
   exit;
 
 }
      
  $array=explode("@",$_SESSION[producelist]);
  for($i=0;$i    {
  if($array[$i]==$id)
   {
      echo "";
   exit;
   }
 }
  $_SESSION[producelist]=$_SESSION[producelist].$id."@";
  $_SESSION[quatity]=$_SESSION[quatity]."1@";
   
  header("location:gouwu1.php");
?>
 
*************************************************gouwu1.php**********************************************
 
 session_start();
 if($_SESSION[username]=="")
  {
    echo "";
 exit;
  }
   
?>
 include("top.php");
?>

 
   
   
   
         
       
   

 
   
 
     
       
     
   
 
     
     
       
         
           
         
         
           
的购物车

                    
     session_start();
     session_register("total");
     if($_GET[qk]=="yes")
     {
        $_SESSION[producelist]="";
     $_SESSION[quatity]="";  
     }
      $arraygwc=explode("@",$_SESSION[producelist]);
      $s=0;
      for($i=0;$i      {
          $s+=intval($arraygwc[$i]);
      }
     if($s==0 )
       {
       echo "
";
                   echo" ";
                   echo"";
    }
     else
      {  
   ?>
               
                 
                 
                 
                 
                 
                 
                 
               
                       $total=0;
       $array=explode("@",$_SESSION[producelist]);
    $arrayquatity=explode("@",$_SESSION[quatity]);
     
     
     
     
     while(list($name,$value)=each($_POST))
        {
       for($i=0;$i       {
         if(($array[$i])==$name)
      {
        $arrayquatity[$i]=$value;   
      }
       }
        
     }
       
       $_SESSION[quatity]=implode("@",$arrayquatity);
     
     
    for($i=0;$i     {  
      
       $id=$array[$i];
       $num=$arrayquatity[$i];
       
      if($id!="")
       {
       $sql=mysql_query("select * from shangpin where id='".$id."'",$conn);
       $info=mysql_fetch_array($sql);
       $total1=$num*$info[huiyuanjia];
       $total+=$total1;
       $_SESSION["total"]=$total;
   ?>
               

                 
                 
                 
                 
                 
                 
                 
               
                          
         }
     }
    ?>
               
                 
               
                    }
   ?>
           
您的购物车为空!
商品名称
数量
市场价
会员价
折扣
小计
操作

                      >
                 

                     
                       
                         
                         
                         
                         
                       
                     

                             
                         
总计:

                 

 

 
 
********************************************gouwu2.php*****************************
 
 

 
   
   
   
 

 
   
 
     
       
     
   
 

     
       
         
       
       
         
       
     
收货人信息

          
    
     
             
             
             
             
           
           
             
             
           
           
             
             
           
           
             
             
           
           
             
             
           
           
             
             
           
           
             
             
           
           
             
             
           
           
             
           
  
         
收货人姓名:
性别:

               
             
详细地址:

             
邮政编码:
联系电话:
电子邮箱:
送货方式:

               
支付方式:

               
             
简单留言:

               

             

 
 if($_GET[dingdanhao]!="")
  {  $dd=$_GET[dingdanhao];
     session_start();
   
     $array=explode("@",$_SESSION[producelist]);
  $sum=count($array)*20+260;
    echo" ";
 
  }
?>
 
***********************************************************conn.php*******************************************************
 
           $conn=mysql_connect("localhost","root","") or die("数据库服务器连接错误".mysql_error());
           mysql_select_db("shop",$conn) or die("数据库访问错误".mysql_error());
           mysql_query("set character set gb2312");
           mysql_query("set names gb2312");
?>
 
 
本文来自: e时代学习吧() 详细出处参考:
阅读(9938) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~