基于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 相关文章推荐
mysql 搜索之简单应用
Apr 27 PHP
php中XMLHttpRequest(Ajax)不能设置自定义的Referer的解决方法
Nov 26 PHP
解析php做推送服务端实现ios消息推送
Jul 01 PHP
WordPress开发中的get_post_custom()函数使用解析
Jan 04 PHP
PHP调用存储过程返回值不一致问题的解决方法分析
Apr 26 PHP
zend framework重定向方法小结
May 28 PHP
php注册和登录界面的实现案例(推荐)
Oct 24 PHP
php插入含有特殊符号数据的处理方法
Nov 24 PHP
thinkPHP显示不出验证码的原因与解决方法分析
May 20 PHP
laravel 5.1下php artisan migrate的使用注意事项总结
Jun 07 PHP
Laravel中的Auth模块详解
Aug 17 PHP
php微信支付之公众号支付功能
May 30 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输出XML到页面的3种方法详解
2013/06/06 PHP
Laravel 5+ .env环境配置文件详解
2020/04/06 PHP
JS 页面内容搜索,类似于 Ctrl+F功能的实现代码
2007/08/13 Javascript
javascript实现的动态添加表单元素input,button等(appendChild)
2007/11/24 Javascript
javascript利用初始化数据装配模版的实现代码
2010/11/17 Javascript
js页面跳转的问题(跳转到父页面、最外层页面、本页面)
2013/08/14 Javascript
javascript实现促销倒计时+fixed固定在底部
2013/09/18 Javascript
JQuery打造省市下拉框联动效果
2014/05/18 Javascript
javascript实现 百度翻译 可折叠的分享按钮列表
2015/03/12 Javascript
JavaScript入门教程之引用类型
2016/05/04 Javascript
Bootstrap table使用方法汇总
2017/11/17 Javascript
Echarts之悬浮框中的数据排序问题
2018/11/08 Javascript
django中使用vue.js的要点总结
2019/07/07 Javascript
javascript 高级语法之继承的基本使用方法示例
2019/11/11 Javascript
JS实现图片幻灯片效果代码实例
2020/05/21 Javascript
[31:55]完美世界DOTA2联赛循环赛 IO vs GXR BO2第一场 11.04
2020/11/05 DOTA
Python多进程库multiprocessing中进程池Pool类的使用详解
2017/11/24 Python
python3.5绘制随机漫步图
2018/08/27 Python
在PyCharm中实现关闭一个死循环程序的方法
2018/11/29 Python
python requests 库请求带有文件参数的接口实例
2019/01/03 Python
python dict 相同key 合并value的实例
2019/01/21 Python
Python字典的基本用法实例分析【创建、增加、获取、修改、删除】
2019/03/05 Python
导致python中import错误的原因是什么
2020/07/01 Python
CSS3旋转——彩色扇子兼容firefox浏览器
2013/06/04 HTML / CSS
css3实现六边形边框的实例代码
2019/05/24 HTML / CSS
美国领先的眼镜和太阳镜在线零售商:Glasses.com
2019/08/26 全球购物
爱尔兰旅游网站:ebookers.ie
2020/01/24 全球购物
Kendra Scott官网:美国领先的时尚配饰品牌
2020/10/22 全球购物
演讲稿的写法
2014/05/19 职场文书
英语专业毕业生求职信
2014/05/24 职场文书
公司周年庆典标语
2014/10/07 职场文书
党员个人整改方案及措施
2014/10/25 职场文书
公司老总年会致辞
2015/07/30 职场文书
用Python创建简易网站图文教程
2021/06/11 Python
php访问对象中的成员的实例方法
2021/11/17 PHP
JavaScript流程控制(分支)
2021/12/06 Javascript