基于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+.htaccess实现全站静态HTML文件GZIP压缩传输(一)
Feb 15 PHP
php 中的str_replace 函数总结
Apr 27 PHP
php file_get_contents抓取Gzip网页乱码的三种解决方法
Nov 12 PHP
PHP缓存集成库phpFastCache用法
Dec 15 PHP
WordPress开发中用于获取近期文章的PHP函数使用解析
Jan 05 PHP
PHP编写的图片验证码类文件分享
Jun 06 PHP
Yii框架中sphinx索引配置方法解析
Oct 18 PHP
浅谈PHP发送HTTP请求的几种方式
Jul 25 PHP
PHP使用星号替代用户名手机和邮箱的实现代码
Feb 07 PHP
PHP+MariaDB数据库操作基本技巧备忘总结
May 21 PHP
laravel 修改记住我功能的cookie保存时间的方法
Oct 14 PHP
PHP Swoole异步读取、写入文件操作示例
Oct 24 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 基于文件头的文件类型验证类函数
2012/05/01 PHP
PHP stripos()函数及注意事项的分析
2013/06/08 PHP
PHP操作MongoDB实现增删改查功能【附php7操作MongoDB方法】
2018/04/24 PHP
javascript 显示当前系统时间代码
2009/12/28 Javascript
Js base64 加密解密介绍
2013/10/11 Javascript
js简单实现用户注册信息的校验代码
2013/11/15 Javascript
解决WordPress使用CDN后博文无法评论的错误
2015/12/15 Javascript
nodejs实现bigpipe异步加载页面方案
2016/01/26 NodeJs
JS区分Object与Aarry的六种方法总结
2017/02/27 Javascript
js实现仿购物车加减效果
2017/03/01 Javascript
微信小程序实现MUI数字输入框效果
2018/01/31 Javascript
关于在vue 中使用百度ueEditor编辑器的方法实例代码
2018/09/14 Javascript
使用vue-cli3新建一个项目并写好基本配置(推荐)
2019/04/24 Javascript
JavaScript命名空间模式实例详解
2019/06/20 Javascript
Promise扫盲贴
2019/06/24 Javascript
如何在node环境实现“get数据解析”代码实例
2020/07/03 Javascript
Vue2.x和Vue3.x的双向绑定原理详解
2020/11/05 Javascript
[01:10:58]Spirit vs NB Supermajor小组赛 A组败者组决赛 BO3 第二场 6.2
2018/06/03 DOTA
python实现批量下载新浪博客的方法
2015/06/15 Python
Python3 利用requests 库进行post携带账号密码请求数据的方法
2018/10/26 Python
Python OpenCV读取png图像转成jpg图像存储的方法
2018/10/28 Python
python的time模块和datetime模块实例解析
2019/11/29 Python
使用python和pygame制作挡板弹球游戏
2019/12/03 Python
Python箱型图处理离群点的例子
2019/12/09 Python
Python 列表推导式需要注意的地方
2020/10/23 Python
纯css3实现的动画按钮的实例教程
2014/11/17 HTML / CSS
捷克建筑材料网上商店:DEK.cz
2021/03/06 全球购物
亿阳信通股份有限公司笔试题(C#)
2016/03/04 面试题
大学同学聚会邀请函
2014/01/19 职场文书
校园会短篇的广播稿
2014/10/21 职场文书
汽车4S店销售经理岗位职责
2015/04/02 职场文书
2015年幼儿园班主任工作总结
2015/05/12 职场文书
2016年公司中秋节致辞
2015/11/26 职场文书
最新的离婚协议书范本!
2019/07/02 职场文书
致创业的您:这类人不适合餐饮创业
2019/08/19 职场文书
Python使用pandas导入xlsx格式的excel文件内容操作代码
2022/12/24 Python