基于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 相关文章推荐
第九节 绑定 [9]
Oct 09 PHP
在PHP3中实现SESSION的功能(一)
Oct 09 PHP
Http 1.1 Etag 与 Last-Modified提高php效率
Jan 10 PHP
PHP simple_html_dom.php+正则 采集文章代码
Dec 24 PHP
php自定义函数call_user_func和call_user_func_array详解
Jul 14 PHP
php文件操作实例代码
May 10 PHP
php笔记之:文章中图片处理的使用
Apr 26 PHP
PHP安全上传图片的方法
Mar 21 PHP
PHP后期静态绑定实例浅析
Dec 21 PHP
PHP多进程通信-消息队列使用
Mar 08 PHP
PHP SESSION机制的理解与实例
Mar 22 PHP
yii2 开发api接口时优雅的处理全局异常的方法
May 14 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(3)
2006/10/09 PHP
PHP设置图片文件上传大小的具体实现方法
2013/10/11 PHP
PHP反射机制用法实例
2014/08/28 PHP
php中print(),print_r(),echo()的区别详解
2014/12/01 PHP
Laravel中日期时间处理包Carbon的简单使用
2017/09/21 PHP
php使用filter_var函数判断邮箱,url,ip格式示例
2019/07/06 PHP
php实现JWT验证的实例教程
2020/11/26 PHP
23个超流行的jQuery相册插件整理分享
2011/04/25 Javascript
html中使用javascript调用本地程序(exe、doc等)实现代码
2013/04/26 Javascript
Express.JS使用详解
2014/07/17 Javascript
JQuery中使用Ajax赋值给全局变量失败异常的解决方法
2014/08/18 Javascript
Js和JQuery获取鼠标指针坐标的实现代码分享
2015/05/25 Javascript
实例详解ECMAScript5中新增的Array方法
2016/04/05 Javascript
js实现上传图片及时预览
2016/05/07 Javascript
Bootstrap弹出框(modal)垂直居中的问题及解决方案详解
2016/06/12 Javascript
JavaScript 网页中实现一个计算当年还剩多少时间的倒数计时程序
2017/01/25 Javascript
vue结合element-ui使用示例
2019/01/24 Javascript
8 个有用的JS技巧(推荐)
2019/07/03 Javascript
[55:47]DOTA2上海特级锦标赛C组小组赛#2 LGD VS Newbee第三局
2016/02/27 DOTA
[48:21]Mski vs VGJ.S Supermajor小组赛C组 BO3 第一场 6.3
2018/06/04 DOTA
Python控制键盘鼠标pynput的详细用法
2019/01/28 Python
python按比例随机切分数据的实现
2019/07/11 Python
python opencv捕获摄像头并显示内容的实现
2019/07/11 Python
Python爬取豆瓣视频信息代码实例
2019/11/16 Python
基于Tensorflow:CPU性能分析
2020/02/10 Python
python sklearn包——混淆矩阵、分类报告等自动生成方式
2020/02/28 Python
Python selenium抓取虎牙短视频代码实例
2020/03/02 Python
在Matplotlib图中插入LaTex公式实例
2020/04/17 Python
Python批量修改xml的坐标值全部转为整数的实例代码
2020/11/26 Python
中国高端家电购物商城:顺电
2018/03/04 全球购物
俄罗斯运动、健康和美容产品在线商店:Lactomin.ru
2020/07/23 全球购物
护理专业自荐信
2013/12/03 职场文书
农村党支部先进事迹
2014/01/14 职场文书
上课随便讲话检讨书
2014/09/12 职场文书
个人对照检查材料思想汇报(四风问题)
2014/09/25 职场文书
经费申请报告
2015/05/15 职场文书