基于PHP+Mysql简单实现了图书购物车系统的实例详解


Posted in PHP onAugust 06, 2020

PHP+Mysql简单实现了图书购物车

本文主要讲述如何通过PHP+HTML简单实现图书购物车的功能,这是提取我们php项目的部分内容。主要内容包括:

    1.通过JavaScript和Iframe实现局部布局界面
    2.PHP如何定义类实现访问数据库功能
    3.实现简单的添加购物车功能
    4.实现了后台管理前台的页面
    由于这个项目是在期末完成,PHP只是刚学的,比较简单。

效果图如下:

这是后台管理的页面:

基于PHP+Mysql简单实现了图书购物车系统的实例详解

这是前台页面:

基于PHP+Mysql简单实现了图书购物车系统的实例详解

基于PHP+Mysql简单实现了图书购物车系统的实例详解

index.php页面:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
 <meta name="renderer" content="webkit">
 <title>后台管理中心</title> 
 <link rel="stylesheet" href="css/pintuer.css" rel="external nofollow" rel="external nofollow" >
 <link rel="stylesheet" href="css/admin.css" rel="external nofollow" rel="external nofollow" >
 <script src="js/jquery.js"></script> 
</head>
<body style="background-color:#f2f9fd;">
<div class="header bg-main">
 <div class="logo margin-big-left fadein-top">
 <h1><img src="images/y.jpg" class="radius-circle rotate-hover" height="50" alt="" />图书管理中心</h1>
 </div>
 <div class="head-l"><a class="button button-little bg-green" href="home/index.php" rel="external nofollow" target="_blank"><span class="icon-home"></span> 前台首页</a>   <a class="button button-little bg-red" href="../lab/login.php" rel="external nofollow" ><span class="icon-power-off"></span> 登录账号</a> </div>
</div>
<div class="leftnav">
 <div class="leftnav-title"><strong><span class="icon-list"></span>菜单列表</strong></div>
 <h2><span class="icon-user"></span>基本设置</h2>
 <ul style="display:block">
 <li><a href="info.php" rel="external nofollow" target="right"><span class="icon-caret-right"></span>查询信息</a></li>
 <li><a href="page.php" rel="external nofollow" target="right"><span class="icon-caret-right"></span>添加信息</a></li> 
 <li><a href="adv.php" rel="external nofollow" target="right"><span class="icon-caret-right"></span>修改信息</a></li> 
 <li><a href="book.php" rel="external nofollow" target="right"><span class="icon-caret-right"></span>删除信息</a></li>
 <li><a href="pass.html" rel="external nofollow" target="right"><span class="icon-caret-right"></span>修改密码</a></li>  

 </ul> 

</div>

<ul class="bread">
 <li><a href="##" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="" class="icon-home"> 首页</a></li>
 <li><a href="##" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="a_leader_txt">网站信息</a></li>
 <li><b>当前语言:</b><span style="color:red;">中文</php></span>
      切换语言:<a href="##" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >中文</a>   <a href="##" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >英文</a> </li>
</ul>
<div class="admin">
 <iframe scrolling="auto" rameborder="0" src="info.php" name="right" width="100%" height="100%"></iframe>
</div>
<div style="text-align:center;">

</div>
</body>
</html>

login.php页面:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
 <meta name="renderer" content="webkit">
 <title>登录</title> 
 <link rel="stylesheet" href="css/pintuer.css" rel="external nofollow" rel="external nofollow" >
 <link rel="stylesheet" href="css/admin.css" rel="external nofollow" rel="external nofollow" >
 <script src="js/jquery.js"></script>
 <script src="js/pintuer.js"></script> 
</head>
<body>
<div class="bg"></div>
<div class="container">
 <div class="line bouncein">
  <div class="xs6 xm4 xs3-move xm4-move">
   <div style="height:150px;"></div>
   <div class="media media-y margin-big-bottom">   
   </div>   
   <form action="login_ok.php" method="post">
   <div class="panel loginbox">
    <div class="text-center margin-big padding-big-top"><h1>图书管理中心</h1></div>
    <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
     <div class="form-group">
      <div class="field field-icon-right">
       <input type="text" class="input input-big" placeholder="登录账号" name="username" data-validate="required:请填写账号" />
       <span class="icon icon-user margin-small"></span>
      </div>
     </div>
     <div class="form-group">
      <div class="field field-icon-right">
       <input type="password" class="input input-big" placeholder="登录密码" name="password" data-validate="required:请填写密码" />
       <span class="icon icon-key margin-small"></span>
      </div>
     </div>
     <div class="form-group">
      <div class="field">
       <input type="text" class="input input-big" name="code" placeholder="填写右侧的验证码" data-validate="required:请填写右侧的验证码" />
       <img src="images/passcode.jpg" alt="" width="80" height="32" class="passcode" style="height:43px;cursor:pointer;" onclick="this.src=this.src+'?'">
             
      </div>
     </div>
    </div>
    <div style="padding:30px;"><input type="submit" class="button button-block bg-main text-big input-big" value="登录"></div>
   </div>
   </form>   
  </div>
 </div>
</div>

</body>
</html>

最后希望文章对大家有所帮助,同时更希望大家学习下PHP类相关的知识。第一次学来写博客,就是练练手,总感觉自己写博客有些问题,但自己说不出来,希望大家提出不足之处!也可以添加我WeChat

到此这篇关于基于PHP+Mysql简单实现了图书购物车系统的实例详解的文章就介绍到这了,更多相关PHP+Mysql实现图书购物车内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

PHP 相关文章推荐
PHP Class&amp;Object -- 解析PHP实现二叉树
Jun 25 PHP
PHP+memcache实现消息队列案例分享
May 21 PHP
laravel安装和配置教程
Oct 29 PHP
php+ajax实现无刷新动态加载数据技术
Apr 28 PHP
PHP合并discuz用户脚本的方法
Aug 04 PHP
PHP表单提交后引号前自动加反斜杠的原因及三种办法关闭php魔术引号
Sep 30 PHP
几个优化WordPress中JavaScript加载体验的插件介绍
Dec 17 PHP
PHP生成图像验证码的方法小结(2种方法)
Jul 18 PHP
PHP 文件上传后端处理实用技巧方法
Jan 06 PHP
PHP后台微信支付和支付宝支付开发
Apr 28 PHP
PHP获取MySQL执行sql语句的查询时间方法
Aug 21 PHP
php实现JWT验证的实例教程
Nov 26 PHP
基于PHP的登录和注册的功能的实现
Aug 06 #PHP
php中try catch捕获异常实例详解
Aug 06 #PHP
PHP日期和时间函数的使用示例详解
Aug 06 #PHP
Apache+PHP+MySQL搭建PHP开发环境图文教程
Aug 06 #PHP
PHP文件打开关闭及读写操作示例解析
Aug 06 #PHP
PHP中-&gt;和=&gt;的含义及使用示例解析
Aug 06 #PHP
基于PHP实现用户登录注册功能的详细教程
Aug 04 #PHP
You might like
浅析php插件 HTMLPurifier HTML解析器
2013/07/01 PHP
php使用curl抓取qq空间的访客信息示例
2014/02/28 PHP
非常实用的php验证码类
2016/05/15 PHP
php版阿里云OSS图片上传类详解
2016/12/01 PHP
Laravel框架Eloquent ORM修改数据操作示例
2019/12/03 PHP
PHP+Redis事务解决高并发下商品超卖问题(推荐)
2020/08/03 PHP
js中查找最近的共有祖先元素的实现代码
2010/12/30 Javascript
Javascript中的Callback方法浅析
2015/03/15 Javascript
JavaScript实现按照指定长度为数字前面补零输出的方法
2015/03/19 Javascript
理解javascript中的原型和原型链
2015/07/30 Javascript
JS基于VML技术实现的五角星礼花效果代码
2015/10/26 Javascript
12个非常实用的JavaScript小技巧【推荐】
2016/05/18 Javascript
AngularJs expression详解及简单示例
2016/09/01 Javascript
vue项目中添加单元测试的方法
2018/07/21 Javascript
解决vue A对象赋值给B对象,修改B属性会影响到A的问题
2018/09/25 Javascript
vue的列表交错过渡实现代码示例
2019/05/05 Javascript
微信小程序开发(三):返回上一级页面并刷新操作示例【页面栈】
2020/06/01 Javascript
jquery插件实现轮播图效果
2020/10/19 jQuery
Python模块学习 datetime介绍
2012/08/27 Python
Python 冒泡,选择,插入排序使用实例
2015/02/05 Python
Python使用time模块实现指定时间触发器示例
2017/05/18 Python
利用python实现简单的邮件发送客户端示例
2017/12/23 Python
Python 判断图像是否读取成功的方法
2019/01/26 Python
python 机器学习之支持向量机非线性回归SVR模型
2019/06/26 Python
Python csv模块使用方法代码实例
2019/08/29 Python
采购部主管岗位职责
2014/01/01 职场文书
出国留学经济担保书
2014/04/01 职场文书
数学教育专业求职信
2014/07/22 职场文书
信用卡工资证明范本
2014/10/17 职场文书
医院保洁员管理制度
2015/08/05 职场文书
小学教师教学反思
2016/02/24 职场文书
关于SpringBoot 使用 Redis 分布式锁解决并发问题
2021/11/17 Redis
Android超详细讲解组件ScrollView的使用
2022/03/31 Java/Android
Python Matplotlib绘制两个Y轴图像
2022/04/13 Python
排查并解决Oracle sysaux表空间异常增长
2022/04/20 Oracle
vue实现登陆页面开发实践
2022/05/30 Vue.js