PHP+Mysql服装商城 网上服装购物商城 基于PHP服装商城的系统设计与实现(2)分类
程序员文章站
2022-03-23 11:19:25
效果图源代码"; $var_Mingcheng=""; $var_Guan...
效果图
源代码
<?php
require "conn.php";
//获取网站标题等信息
$sql_xg="select * from web_key where id=1";
$jieguo_xg=mysqli_query($conn,$sql_xg);
if(!$jieguo_xg){
die("不能获取数据");
}
//echo "<hr>";
$var_Mingcheng="";
$var_Guanjianzi="";
$var_Miaoshu="";
while ($row_xg=mysqli_fetch_array($jieguo_xg,MYSQLI_ASSOC)){
//echo "{$row["id"]}"."{$row["cn"]}"."{$row["en"]}"."<br>";
$var_Mingcheng=$row_xg["Mingcheng"];
$var_Guanjianzi=$row_xg["Guanjianzi"];
$var_Miaoshu=$row_xg["Miaoshu"];
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $var_Mingcheng ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/chanpin_fenlei.css">
<link rel="stylesheet" href="css/dibu_caidan.css">
</head>
<body>
<!--商品分类-->
<div class="fenlei">
<!--商品分类-左侧-->
<div class="fenlei_zuo">
<a class="fenlei_zuo_xiangmu
<?php
//$cs_lxid = $_GET["cs_lxid"];
if(empty($_GET['cs_lxid'])){
echo " fenlei_zuo_xuanzhong ";
}
?>
" href="fenlei.php">所有分类</a>
<?php
$sql_fl="select * from shangpin_fenlei where caidan_jibie=1 ";
$jieguo_fl=mysqli_query($conn,$sql_fl);
if(!$jieguo_xg){
die("不能获取数据");
}
while ($row_fl=mysqli_fetch_array($jieguo_fl,MYSQLI_ASSOC)){
$var_flid=$row_fl["id"];
$var_caidan_mingcheng=$row_fl["caidan_mingcheng"];
?>
<a class="fenlei_zuo_xiangmu
<?php
if(empty($_GET['cs_lxid'])){
}else{
if($var_flid==$_GET['cs_lxid']){
echo " fenlei_zuo_xuanzhong ";
}
}
?>
" href="fenlei.php?cs_lxid=<?php echo $var_flid ?>"><?php echo $var_caidan_mingcheng ?></a>
<?php
}
?>
</div>
<!--商品分类-右侧-->
<div class="fenlei_you">
<div class="cp2_zuixin">
<?php
$sql = "";
if(empty($_GET['cs_lxid'])){
$sql="select * from shangpin order by id desc limit 9";
}else{
$sql="select * from shangpin where lx_id1=".$_GET['cs_lxid']." order by id desc limit 9";
}
$jieguo=mysqli_query($conn,$sql);
if(!$jieguo){
die("不能获取数据");
}
while ($row=mysqli_fetch_array($jieguo,MYSQLI_ASSOC))
{
?>
<a href="cp_xinxi1.php?cs_id=<?php echo $row["id"] ?>" target="_blank" class="cp2_lianjie">
<img src="/up/<?php echo $row["cp_tupian"] ?>" class="cp2_img" />
<p class="cp2_mc"><?php echo $row["mingcheng"] ?></p>
<p class="cp_mc2">¥ <?php echo $row["jiage1"] ?></p>
</a>
<?php
}
?>
</div>
</div>
</div>
<!--底部菜单-->
<?php include 'dibu_menu.php'; ?>
</body>
</html>
参考网址:www.pc-365.net
本文地址:https://blog.csdn.net/u013818205/article/details/109235610