• 大小: 0.12M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-29
  • 标签: 购物车  

资源简介

购物车

资源截图

代码片段和文件信息

/*
*添加商品ID 和数量到购物车存放到SESSION中
*/
header(“content-type:text/html;charset=utf-8“);
$varid=$_GET[‘id‘];
session_start();
if(!empty($varid)){
if($_SESSION[‘goodid‘]==““ && $_SESSION[‘goodnum‘]==““){
$_SESSION[‘goodid‘]=“{$varid}@“;
$_SESSION[‘goodnum‘]=“1@“;
echo“ript>alert(‘商品添加至购物车!‘);ript>“;
echo“ript>location.href=‘buy_list.php‘;ript>“;
}else{
$arr=explode(“@“ $_SESSION[‘goodid‘]);
if(in_array(“{$varid}“ $arr)){
echo“ript>alert(‘您所添加的商品购物车中已经存在!‘);ript>“;
echo“ript>location.href=‘buy_list.php‘;ript>“;
}else{
$_SESSION[‘goodid‘].=“{$varid}@“;
$_SESSION[‘goodnum‘].=“1@“;
echo“ript>alert(‘商品添加至购物车!‘);ript>“;
echo“ript>location.href=‘buy_list.php‘;ript>“;
}
}
}else{
echo“ript>a

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        174  2015-07-29 09:11  shopping\.buildpath

     文件        518  2015-07-29 09:11  shopping\.project

     文件         88  2015-07-29 10:14  shopping\.settings\org.eclipse.core.resources.prefs

     文件         88  2015-07-29 09:11  shopping\.settings\org.eclipse.php.core.prefs

     文件       1106  2015-07-29 10:16  shopping\admin\add.php

     文件       1395  2015-07-29 10:25  shopping\admin\conf_admin.php

     文件       9394  2015-07-27 08:32  shopping\admin\image\20150729\1_s.jpg

     文件      18119  2015-07-27 08:26  shopping\admin\image\20150729\5884.jpg

     文件      17996  2015-07-27 08:26  shopping\admin\image\20150729\6328.jpg

     文件       6449  2015-07-27 08:30  shopping\admin\image\20150729\8_s.jpg

     文件      19702  2015-07-27 08:30  shopping\admin\image\20150729\u=36187745021158377218&fm=72.jpg

     文件       9394  2015-07-30 08:47  shopping\admin\image\20150730\201507300047001424704.jpg

     文件       6449  2015-07-30 08:48  shopping\admin\image\20150730\201507300048036151353.jpg

     文件      18119  2015-07-30 08:51  shopping\admin\image\20150730\201507300051158242497.jpg

     文件      17996  2015-07-30 08:53  shopping\admin\image\20150730\201507300053079691868.jpg

     文件       1006  2015-07-29 14:51  shopping\buy_car.php

     文件       3279  2015-07-30 10:08  shopping\buy_list.php

     文件        212  2015-07-29 09:15  shopping\config\config.php

     文件        672  2015-07-29 14:19  shopping\conf_inc.php

     文件        730  2015-07-29 11:17  shopping\css\css.css

     文件        810  2015-07-29 16:52  shopping\data.php

     文件       1650  2015-07-29 15:44  shopping\index.php

     文件        868  2015-07-30 09:20  shopping\modify.js

     目录          0  2015-08-21 14:14  shopping\admin\image\20150729

     目录          0  2015-08-21 14:14  shopping\admin\image\20150730

     目录          0  2015-08-21 14:14  shopping\admin\image

     目录          0  2015-08-21 14:14  shopping\.settings

     目录          0  2015-08-21 14:14  shopping\admin

     目录          0  2015-08-21 14:14  shopping\config

     目录          0  2015-08-21 14:14  shopping\css

............此处省略4个文件信息

评论

共有 条评论