您的位置:首页 > 编程语言 > PHP开发

php 简易购物习题

2016-06-29 19:45 543 查看
1.货物界面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#main{ width:100%}
#left{ width:20%; float:left}
#right{ width:80%; float:left}
</style>
</head>

<body>
<?php
session_start();

if(empty($_SESSION["uid"]))
{
header("location:gouwu2.php");
exit;
}
include("DBDA.php");
$db=new DBDA();

$uid=$_SESSION["uid"];

$sql="select account from login where username='{$uid}'";
$yue=$db->StrQuery($sql);

?>
<div id="main">
<div id="left">
<div><a href="gouwu.php">浏览商品</a></div>
<div><a href="gouwu4.php">查看账户</a></div>
<div><a href="gouwu3.php">查看购物车</a></div>
</div>
<div id="right">
您的账户余额为:<?php echo $yue ?>元
</div>
</div>

</body>
</html>


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: