1、商品展示页面
代码如下:
PHP if(trim($info[tupian]=="")) { echo "暂无图片"; } else { ?> PHP } ?> | 】 | |
】 | ||
】 | ||
】 | ||
】 | ||
数量: PHP if(($info[shuliang]-$info[cishu])>0) { echo ($info[shuliang]-$info[cishu]); } else { echo "已售完"; } ?>】 |
}
?>
代码如下:
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");
?>
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");
?>
代码如下:
代码如下:
if($_GET[dingdanhao]!="")
{ $dd=$_GET[dingdanhao];
session_start(); $array=explode("@",$_SESSION[producelist]);
$sum=count($array)*20+260;
echo" "; }
?>
代码如下:
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");
?>
$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");
?>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。