"; $var_Mingcheng=""; $var_Guan_商品店首页的php代码是什么">
当前位置:   article > 正文

PHP+Mysql服装商城 网上服装购物商城 基于PHP服装商城的系统设计与实现(1)首页_商品店首页的php代码是什么

商品店首页的php代码是什么

效果图

在这里插入图片描述

源代码

<?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"];
    }	
	
	//广告数据
    $sql_ad="select * from guanggao where id=1";
    $jieguo_ad=mysqli_query($conn,$sql_ad);
    if(!$jieguo_ad){
        die("不能获取数据");
    }
    while ($row_ad=mysqli_fetch_array($jieguo_ad,MYSQLI_ASSOC)){
        //echo "{$row["id"]}"."{$row["cn"]}"."{$row["en"]}"."<br>";
        $wz1=$row_ad["wz1"];
        $tpdz1=$row_ad["tpdz1"];
        $ljdz1=$row_ad["ljdz1"];
		
        $wz2=$row_ad["wz2"];
        $tpdz2=$row_ad["tpdz2"];
        $ljdz2=$row_ad["ljdz2"];
		
        $wz3=$row_ad["wz3"];
        $tpdz3=$row_ad["tpdz3"];
        $ljdz3=$row_ad["ljdz3"];
		
        $wz4=$row_ad["wz4"];
        $tpdz4=$row_ad["tpdz4"];
        $ljdz4=$row_ad["ljdz4"];						
    }		
?>	
<!doctype html>
<html>
<head>
<meta charset="utf-8">

<title><?php echo $var_Mingcheng ?></title>
<meta name="keywords" content="<?php echo $var_Guanjianzi ?>" />
<meta name="description" content="<?php echo $var_Miaoshu ?>" />

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/shouye.css">
<link rel="stylesheet" href="css/dibu_caidan.css">

<link rel="stylesheet" type="text/css" href="css2/normalize.css" />
<link rel="stylesheet" type="text/css" href="css2/style.css">
<link rel="stylesheet" type="text/css" href="css2/entypo.css">
</head>
<body>

<!--查询功能-->
<form  method="post" action="index_cx.php">
<div class="chaxun">
  <input class="chaxun_neirong" name="cx_neirong" type="text" placeholder="&nbsp;请输入要查询的内容" />
  <button class="chaxun_anniu">查询</button>
</div>

</form>  
	
<!--轮播图片-->
<div class='o-sliderContainer' id="pbSliderWrap0" style="margin-top:0;">
	<div class='o-slider' id='pbSlider0'>
		<a href="<?php echo $ljdz1?>" target="_blank">
        <div class="o-slider--item" data-image="/up/<?php echo $tpdz1?>">
		  <div class="o-slider-textWrap">
			<h1 class="o-slider-title"><?php echo $wz1?></h1>
			<span class="a-divider"></span>
			<!--h2 class="o-slider-subTitle">--限时打折活动开启--</h2-->
		  </div>
		</div></a>
        
        <a href="<?php echo $ljdz2?>" target="_blank">
		<div class="o-slider--item" data-image="/up/<?php echo $tpdz2?>">
		  <div class="o-slider-textWrap">
			<h1 class="o-slider-title"><?php echo $wz2?></h1>
			<span class="a-divider"></span>
			<span class="a-divider"></span>
		  </div>
		</div></a>
        
        <a href="<?php echo $ljdz3?>" target="_blank">
		<div class="o-slider--item" data-image="/up/<?php echo $tpdz3?>">
		  <div class="o-slider-textWrap">
			<h1 class="o-slider-title"><?php echo $wz3?></h1>
			<span class="a-divider"></span>
			<span class="a-divider"></span>
		  </div>
		</div></a>
        
        <a href="<?php echo $ljdz4?>" target="_blank">
		<div class="o-slider--item" data-image="/up/<?php echo $tpdz4?>">
		  <div class="o-slider-textWrap">
			<h1 class="o-slider-title"><?php echo $wz4?></h1>
			<span class="a-divider"></span>
			<span class="a-divider"></span>
		  </div>
		</div></a>
        
</div>


<script src="js2/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src='js2/hammer.min.js'></script>
<script src='js2/slider.js'></script>
<script>
	$('#pbSlider0').pbTouchSlider({
	slider_Wrap: '#pbSliderWrap0',
	slider_Threshold: 10,
	slider_Speed:600,
	slider_Ease:'ease-out',
	slider_Drag : true,
	slider_Arrows: {
	  enabled : true
	},
	slider_Dots: {
	  class :'.o-slider-pagination',
	  enabled : true
	},
	slider_Breakpoints: {
		default: {
			height: 500
		},
		tablet: {
			height: 350,
			media: 1024
		},
		smartphone: {
			height: 250,
			media: 768
		}
	}
	});

</script>
</div>

<!--导航快捷菜单-->
<div class="caidan" >
	<a href="cp_list.php" class="caidan_lianjie">
		<img src="img/menu01.png"  class="caidan_img" />
		<p>所有商品</p>
	</a>
	<a href="xinxi_list.php?cs_lxid=237&cs_lxmf=平台介绍" class="caidan_lianjie">
		<img src="img/menu02.png"  class="caidan_img" />
		<p>平台介绍</p>
	</a>
	<a href="xinxi_list.php?cs_lxid=236&cs_lxmf=帮助中心" class="caidan_lianjie">
		<img src="img/menu03.png"  class="caidan_img" />
		<p>帮助中心</p>
	</a>
<?php
//检查cookie是否已设置
if(isset($_COOKIE['h_name'])){
//登录状态
?>    
	<a  href="u_index.php" class="caidan_lianjie" >
		<img src="img/menu04.png"  class="caidan_img" />
		<p>用户中心</p>
	</a>
<?php 
	//echo '登录用户名:' . @$_COOKIE["u_name"]." | 用户id: " . @$_COOKIE["u_id"] . "| 分组id: " . @$_COOKIE["u_fzid"];
}
else //没有登录
{
?>
	<a  class="caidan_lianjie" style="cursor: pointer;" onclick=lg('/u_login.php') >
		<img src="img/menu04.png"  class="caidan_img" />
		<p>用户中心</p>
	</a>
<?php 
}
?>
<script language="javascript">
	function sc(cpid)
	{
		//alert(cpid);
		frame01.location = "/u_shoucang.php?cs_cpid=" + cpid;		
	}	
	function gwc(cpid,cpmc,cpjiage1,cpjiage2)
	{
		alert(cpid+" | "+cpmc+" | "+cpjiage1+" | "+cpjiage2);
		frame01.location = "/gwc_add.php?cs_cpid=" + cpid + "&cs_cpmc=" + cpmc + "&cs_cpjiage1="+ cpjiage1 + "&cs_cpjiage2=" + cpjiage2;		
	}		
	function lg(url)
	{
		if (confirm("没有登录,点击确认跳转到登录页面!"))
		{
			window.location.href=url;
		}
	}
</script>	
	
</div>

<!--最新通知-->
<?php
$sql="select  * from zixun order by id desc limit 3";
$jieguo=mysqli_query($conn,$sql);
if(!$jieguo){
    die("不能获取数据");
}
while ($row=mysqli_fetch_array($jieguo,MYSQLI_ASSOC))
	{
?>	
<div class="tongzhi">
	<a href="xinxi_xiangqing.php?cs_xinxi_id=<?php echo $row["id"] ?>" class="tongzhi_lianjie">
	<img class="tongzhi_zuo" src="img/news.png" />
	<p class="tongzhi_neirong"><?php echo $row["xinxi_biaoti"] ?></p>
	<img class="tongzhi_you" src="img/right.png" />
	</a>
</div>
<?php
	}
?>
	

<!--区块标题-->
<div class="qukuai">
	<p class="qukuai_zuo"></p>
	<p class="qukuai_zhong">最新上架</p>
	<a href="cp_list.php" target="_blank" class="qukuai_you"> 更多> </a>
</div>

<!--最新上架产品-->
<div class="cp_zuixin">
<?php
$sql="select  * from shangpin where zhuangtai_yn=0 and tuijian_yn=0  order by id desc limit 4"; //zhuangtai_yn 0正常 1表示下架
$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"] ?>"  class="cp_lianjie">
		<img  src="/up/<?php echo $row["cp_tupian"] ?>" class="cp_img" />
		<p class="cp_mc"><?php echo $row["mingcheng"] ?></p>
		<p class="cp_mc2">¥<?php echo $row["jiage1"] ?></p>
	</a>
<?php
	}
?>
	
</div>

<!--精品推荐-->
<div class="qukuai2">
	<p class="qukuai_zuo"></p>
	<p class="qukuai_zhong">精品推荐</p>
	<a href="cp_list.php" target="_blank" class="qukuai_you"> 更多> </a>
</div>
<div class="cp2_zuixin">
<?php
//tuijian_yn 1表示推荐 0表示普通
$sql="select  * from shangpin where zhuangtai_yn=0  and tuijian_yn=1  order by id desc limit 6";
$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"] ?>"  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>

<br><br><br>
<!--底部菜单-->
<?php include 'dibu_menu.php'; ?>
	


</body>
</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294

参考网址:www.pc-365.net

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号