博客列表 >12月09日-12月15日大作业-九期线上班

12月09日-12月15日大作业-九期线上班

WJF
WJF原创
2019年12月16日 19:11:38670浏览

暂时只实现了查询功能 这几天现实有事 抽时间补上后台增加 修改 功能 和 用户管理




代码

DB.PHP:

  1. <?php
  2. //命名空间
  3. namespace mvc;
  4. //创建类
  5. class Db{
  6. //配置数据库信息
  7. private $db = [
  8. 'type' => 'mysql',
  9. 'host' => '127.0.0.1',
  10. 'dbname' => 'php1212',
  11. 'username' => 'php1212',
  12. 'password' => 'php1212',
  13. ];
  14. public static $pdo;
  15. //构造方法
  16. private function __construct(...$params)
  17. {
  18. $dsn = $this->db['type'] . ':host=' .$this->db['host'] . ';dbname=' . $this->db['dbname'];
  19. $username = $this->db['username'];
  20. $password = $this->db['password'];
  21. try{
  22. self::$pdo = new \PDO($dsn,$username,$password);
  23. // echo '测试连接成功';
  24. }catch (\PDOException $e){
  25. die('数据库失败 错误信息:' . $e->getMessage());
  26. }
  27. }
  28. //单例模式判断重复连接
  29. public static function connect(...$params){
  30. //判断是否已经实例化
  31. if (is_null(self::$pdo)){
  32. new self(...$params);
  33. }
  34. return self::$pdo;
  35. }
  36. //禁止外部克隆方法
  37. private function __clone()
  38. {
  39. // ****
  40. }
  41. // //新增,更新,删除数据库操作
  42. // public static function exec($sql){
  43. // $stmt = self::$pdo->prepare($sql);
  44. // $stmt->execute();
  45. // }
  46. //获取单条数据
  47. public static function fetch($sql){
  48. $stmt = self::$pdo->prepare($sql);
  49. $stmt->execute();
  50. return $stmt->fetch(\PDO::FETCH_ASSOC);
  51. }
  52. //获取多条数据
  53. public static function fetchAll($sql){
  54. $stmt = self::$pdo->prepare($sql);
  55. $stmt->execute();
  56. return $stmt->fetchAll(\PDO::FETCH_ASSOC);
  57. }
  58. }
  59. //new Db();

Model.php:

  1. <?php
  2. //命名空间
  3. namespace mvc;
  4. //引入Db文件
  5. require __DIR__ . '/Db.php';
  6. class Model{
  7. public $data;
  8. // 构造方法 连接数据库
  9. public function __construct()
  10. {
  11. Db::connect();
  12. }
  13. //获取多条数据
  14. public function getAll($from){
  15. $sql = "SELECT * FROM {$from}";
  16. $this->data = Db::fetchAll($sql);
  17. return $this->data;
  18. }
  19. //获取指定行数数据
  20. public function getLimit($from,$limit){
  21. $sql = "SELECT * FROM {$from} LIMIT {$limit}";
  22. $this->data = Db::fetchAll($sql);
  23. return $this->data;
  24. }
  25. //获取单条数据
  26. public function get($from,$id){
  27. $sql = "SELECT * FROM {$from} WHERE id= {$id}";
  28. $this->data = Db::fetch($sql);
  29. return $this->data;
  30. }
  31. }

view.php:

  1. <?php
  2. namespace mvc;
  3. class View{
  4. //获取多条数据
  5. public function fetch($data){
  6. return $data;
  7. }
  8. //获取单条数据
  9. public function find($data){
  10. return $data;
  11. }
  12. }

Container.php:

  1. <?php
  2. namespace mvc;
  3. require __DIR__ . '/Model.php';
  4. require __DIR__ . '/View.php';
  5. //创建服务容器
  6. class Container{
  7. public $int = [];
  8. public function bind($alias,\Closure $process){
  9. $this->int[$alias] = $process;
  10. }
  11. public function make($alias, $params = []){
  12. return call_user_func_array($this->int[$alias],$params);
  13. }
  14. }
  15. $container = new Container();
  16. $container->bind('model',function (){
  17. return new Model();
  18. });
  19. $container->bind('view',function (){
  20. return new View();
  21. });
  22. //门面模式
  23. class Facade{
  24. //接受实例化容器
  25. protected static $container;
  26. //绑定数据
  27. protected static $data;
  28. protected static $id;
  29. public static function initialize(Container $container){
  30. static::$container = $container;
  31. }
  32. //查询多条数据
  33. public static function getAll($from){
  34. static::$data = static::$container->make('model')->getAll($from);
  35. }
  36. //查询多条指定行数数据
  37. public static function getLimit($from,$limit){
  38. static::$data = static::$container->make('model')->getLimit($from,$limit);
  39. }
  40. //查询单条数据
  41. public static function get($from,$id){
  42. static::$id = static::$container->make('model')->get($from,$id);
  43. }
  44. public static function fetch(){
  45. return static::$container->make('view')->fetch(static::$data);
  46. }
  47. public static function find(){
  48. return static::$container->make('view')->find(static::$id);
  49. }
  50. }
  51. //创建控制器
  52. class Controller{
  53. public function __construct(Container $container)
  54. {
  55. Facade::initialize($container);
  56. }
  57. //多条数据config全部文章
  58. public function getAll($from){
  59. Facade::getAll($from);
  60. return Facade::fetch();
  61. }
  62. //指定行数文章数据表
  63. public function getLimit($from,$limit){
  64. Facade::getLimit($from,$limit);
  65. return Facade::fetch();
  66. }
  67. //调用单条文章数据
  68. public function get($from,$id)
  69. {
  70. //获取数据
  71. Facade::get($from,$id);
  72. //渲染模板
  73. return Facade::find();
  74. }
  75. }
  76. $controller = new Controller($container);
  77. $Articlen = $controller->getLimit('Article',"0,1")[0];
  78. $Articlez = $controller->getLimit('Article',"0,8");
  79. $Articley = $controller->getLimit('Article',"8,8");
  80. $config = $controller->getAll('config')[0];
  81. $Articled = $controller->get('Article',"$_GET[id]");
  82. $imglista1 = $controller->getLimit('image',"0,2");
  83. $imglista2 = $controller->getLimit('image',"2,2");
  84. $imglistb1 = $controller->getLimit('image',"4,2");
  85. $imglistb2 = $controller->getLimit('image',"6,2");
  86. $imglistc1 = $controller->getLimit('image',"8,2");
  87. $imglistc2 = $controller->getLimit('image',"10,2");
  88. $imgd = $controller->get('image',"$_GET[id]");
  89. $shoplist1 = $controller->getLimit('shop',"0,4");
  90. $shoplist2 = $controller->getLimit('shop',"4,4");
  91. $shopd = $controller->get('shop',"$_GET[id]");

index.php:

  1. <?php
  2. require __DIR__ . '/centre/Container.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8">
  8. <title>首页-<?php echo $config['name']; ?></title>
  9. <meta name="keywords" content="<?php echo $config['keyword']; ?>">
  10. <meta name="description" content="<?php echo $config['describe']; ?>">
  11. <!-- <link rel="stylesheet" href="static/css/reset.css">-->
  12. <link rel="stylesheet" href="static/font/iconfont.css">
  13. <link rel="stylesheet" href="static/css/index.css">
  14. </head>
  15. <body>
  16. <!--公共顶部导航区-->
  17. <header>
  18. <a href="">网站首页</a>
  19. <a href="">专题</a>
  20. <a href="">网站导航</a>
  21. <a href="">二手商品</a>
  22. <a href="">讨论区</a>
  23. <span><a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a><a href="">免费注册</a></span>
  24. </header>
  25. <!--logo+搜索框+快捷入口区-->
  26. <div class="logo">
  27. <img src="static/images/logo.png" alt="">
  28. <label>
  29. <input type="search">
  30. <a href="" class="iconfont icon-jinduchaxun"></a>
  31. </label>
  32. <span>
  33. <a href="" class="iconfont icon-huiyuan1"></a>
  34. <a href="" class="iconfont icon-danmu"></a>
  35. <a href="" class="iconfont icon-duoxuankuang"></a>
  36. <a href="" class="iconfont icon-jishufuwu"></a>
  37. <a href="" class="iconfont icon-peiwangyindao"></a>
  38. <a href="" class="iconfont icon-wenjianjia"></a>
  39. <a href="" class="iconfont icon-huiyuan1"></a>
  40. </span>
  41. </div>
  42. <!--主导航区-->
  43. <nav>
  44. <div>
  45. <span class="iconfont icon-gongdan"></span>
  46. <span>资讯 <br> 看学</span>
  47. <a href="">器材</a>
  48. <a href="">大师</a>
  49. <a href="">学院</a>
  50. <a href="">影赛</a>
  51. <a href="">器材</a>
  52. <a href="">大师</a>
  53. <a href="">学院</a>
  54. <a href="">影赛</a>
  55. </div>
  56. <div>
  57. <span class="iconfont icon-renwujincheng"></span>
  58. <span>资讯 <br> 看学</span>
  59. <a href="">器材</a>
  60. <a href="">大师</a>
  61. <a href="">学院</a>
  62. <a href="">影赛</a>
  63. <a href="">器材</a>
  64. <a href="">大师</a>
  65. <a href="">学院</a>
  66. <a href="">影赛</a>
  67. </div>
  68. <div>
  69. <span class="iconfont icon-gongdan"></span>
  70. <span>资讯 <br> 看学</span>
  71. <a href="">器材</a>
  72. <a href="">大师</a>
  73. <a href="">学院</a>
  74. <a href="">影赛</a>
  75. <a href="">器材</a>
  76. <a href="">大师</a>
  77. <a href="">学院</a>
  78. <a href="">影赛</a>
  79. </div>
  80. <div>
  81. <span class="iconfont icon-DOC"></span>
  82. <span>资讯 <br> 看学</span>
  83. <a href="">器材</a>
  84. <a href="">大师</a>
  85. <a href="">学院</a>
  86. <a href="">影赛</a>
  87. <a href="">器材</a>
  88. <a href="">大师</a>
  89. <a href="">学院</a>
  90. <a href="">影赛</a>
  91. </div>
  92. </nav>
  93. <!--轮播图-->
  94. <div class="slider">
  95. <img src="static/images/1.jpg" alt="">
  96. <img src="static/images/banner-right.jpg" alt="">
  97. </div>
  98. <!--新闻资讯区-->
  99. <div class="news">
  100. <div class="title">
  101. <a>新闻资讯</a>
  102. <a href="">更多</a>
  103. </div>
  104. <div class="content">
  105. <div class="pic">
  106. <a href=""><img src="static/images/news.jpg" alt="" class="first-img"></a>
  107. <a href=""><img src="static/images/n-2.jpg" alt=""></a>
  108. <a href=""><img src="static/images/n-3.jpg" alt=""></a>
  109. <a href="">三星Note10/10+发布 <br> 搭载挖孔前摄</a>
  110. <a href="">小米公布6400万 <br> 和1亿像素手机信息</a>
  111. </div>
  112. <div class="list">
  113. <a href="">[new]<?php echo $Articlen['title']; ?></a>
  114. <ul>
  115. <?php
  116. //循环数组
  117. foreach ($Articlez as $v) {
  118. echo "<li><span>[新闻]</span><a href='article.php?id=$v[id]'>" . $v['title'] . "</a></li>";
  119. }
  120. ?>
  121. </ul>
  122. </div>
  123. <div class="list">
  124. <a href="">[new]<?php echo $Articlen['title']; ?></a>
  125. <ul>
  126. <?php
  127. //循环数组
  128. foreach ($Articley as $v) {
  129. echo "<li><span>[新闻]</span><a href='article.php?id=$v[id]'>" . $v['title'] . "</a></li>";
  130. }
  131. ?>
  132. </ul>
  133. </div>
  134. </div>
  135. </div>
  136. <!--图片专区-->
  137. <div class="title">
  138. <span>图片专区</span>
  139. </div>
  140. <div class="picture">
  141. <div>
  142. <div>
  143. <a href="">壁纸</a>
  144. <span>纵观摄影艺术</span>
  145. </div>
  146. <?php
  147. foreach ($imglista1 as $v) {
  148. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  149. }
  150. ?>
  151. <?php
  152. foreach ($imglista1 as $v) {
  153. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  154. }
  155. ?>
  156. <?php
  157. foreach ($imglista2 as $v) {
  158. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  159. }
  160. ?>
  161. <?php
  162. foreach ($imglista2 as $v) {
  163. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  164. }
  165. ?>
  166. </div>
  167. <div>
  168. <div>
  169. <a href="">壁纸</a>
  170. <span>纵观摄影艺术</span>
  171. </div>
  172. <?php
  173. foreach ($imglistb1 as $v) {
  174. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  175. }
  176. ?>
  177. <?php
  178. foreach ($imglistb1 as $v) {
  179. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  180. }
  181. ?>
  182. <?php
  183. foreach ($imglistb2 as $v) {
  184. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  185. }
  186. ?>
  187. <?php
  188. foreach ($imglistb2 as $v) {
  189. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  190. }
  191. ?>
  192. </div>
  193. <div>
  194. <div>
  195. <a href="">壁纸</a>
  196. <span>纵观摄影艺术</span>
  197. </div>
  198. <?php
  199. foreach ($imglistc1 as $v) {
  200. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  201. }
  202. ?>
  203. <?php
  204. foreach ($imglistc1 as $v) {
  205. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  206. }
  207. ?>
  208. <?php
  209. foreach ($imglistc2 as $v) {
  210. echo "<a href='image-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='162' height='122'></a>";
  211. }
  212. ?>
  213. <?php
  214. foreach ($imglistc2 as $v) {
  215. echo "<a href='image-content.php?id=$v[id]'><span>$v[title]</span></a>";
  216. }
  217. ?>
  218. </div>
  219. </div>
  220. <!--二手交易专区-->
  221. <div class="title">
  222. <span>二手交易</span>
  223. </div>
  224. <div class="second-hand">
  225. <div>
  226. <a href="">抢好货</a>
  227. <span>0低价, 便捷,安全,快速</span>
  228. </div>
  229. <div>
  230. <span>热门分类</span>
  231. <a href="">美女写真</a>
  232. <a href="">日本美女</a>
  233. <a href="">美国美女</a>
  234. <a href="">国内美女</a>
  235. <a href="">AV美女</a>
  236. </div>
  237. <?php
  238. foreach ($shoplist1 as $v) {
  239. echo "<a href='shop-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='176' height='120'></a>";
  240. }
  241. ?>
  242. <?php
  243. foreach ($shoplist1 as $v) {
  244. echo "<div class='detail'>
  245. <a href=''>$v[title]</a>
  246. <div>
  247. <a href=''><span>&yen; $v[price]</span><span>$v[classification]</span></a>
  248. </div>
  249. </div>";
  250. }
  251. ?>
  252. <?php
  253. foreach ($shoplist2 as $v) {
  254. echo "<a href='shop-content.php?id=$v[id]'><img src='$v[cover]' alt='' width='176' height='120'></a>";
  255. }
  256. ?>
  257. <?php
  258. foreach ($shoplist2 as $v) {
  259. echo "<div class='detail'>
  260. <a href=''>$v[title]</a>
  261. <div>
  262. <a href=''><span>&yen; $v[price]</span><span>$v[classification]</span></a>
  263. </div>
  264. </div>";
  265. }
  266. ?>
  267. <div>
  268. <a href=""><img src="static/images/ad/1.png" alt="" width="180" height="112"></a>
  269. <a href=""><img src="static/images/ad/2.png" alt="" width="180" height="112"></a>
  270. <a href=""><img src="static/images/ad/3.png" alt="" width="180" height="112"></a>
  271. <a href=""><img src="static/images/ad/4.png" alt="" width="180" height="112"></a>
  272. <a href=""><img src="static/images/ad/image.png" alt="" width="393" height="56"></a>
  273. <a href=""><img src="static/images/ad/ad2.jpg" alt="" width="393" height="56"></a>
  274. </div>
  275. </div>
  276. <!--合作网站-->
  277. <div class="title" style="background:#fff">
  278. <span>合作网站</span>
  279. </div>
  280. <div class="my-links">
  281. <a href="https://www.php.cn">php中文网</a>
  282. <a href="https://www.html.cn">html中文网</a>
  283. <a href="https://www.py.cn">python中文网</a>
  284. <a href="https://www.php.cn">php中文网</a>
  285. <a href="https://www.html.cn">html中文网</a>
  286. <a href="https://www.py.cn">python中文网</a>
  287. <a href="https://www.php.cn">php中文网</a>
  288. <a href="https://www.html.cn">html中文网</a>
  289. <a href="https://www.py.cn">python中文网</a>
  290. <a href="https://www.php.cn">php中文网</a>
  291. <a href="https://www.html.cn">html中文网</a>
  292. <a href="https://www.py.cn">python中文网</a>
  293. <a href="https://www.py.cn">python中文网</a>
  294. <a href="https://www.php.cn">php中文网</a>
  295. <a href="https://www.html.cn">html中文网</a>
  296. <a href="https://www.py.cn">python中文网</a>
  297. <a href="https://www.php.cn">php中文网</a>
  298. <a href="https://www.html.cn">html中文网</a>
  299. <a href="https://www.py.cn">python中文网</a>
  300. <a href="https://www.php.cn">php中文网</a>
  301. <a href="https://www.html.cn">html中文网</a>
  302. <a href="https://www.py.cn">python中文网</a>
  303. <a href="https://www.php.cn">php中文网</a>
  304. <a href="https://www.html.cn">html中文网</a>
  305. <a href="https://www.py.cn">python中文网</a>
  306. <a href="https://www.py.cn">python中文网</a>
  307. </div>
  308. <!--页底部-->
  309. <footer>
  310. <div>
  311. <a href="">简介</a>
  312. <a href="">联系我们</a>
  313. <a href="">招聘信息</a>
  314. <a href="">友情链接</a>
  315. <a href="">用户服务协议</a>
  316. <a href="">隐私权声明</a>
  317. <a href="">法律投诉声明</a>
  318. </div>
  319. <div><span>LOGO</span></div>
  320. <div>
  321. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  322. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  323. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  324. </div>
  325. <div>
  326. <p>关注公众号</p>
  327. <img src="static/images/erwei-code.png" alt="">
  328. </div>
  329. </footer>
  330. </body>
  331. </html>

article.php:

  1. <?php
  2. require __DIR__ . '/centre/Container.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8">
  8. <title><?php echo $Articled['title']; ?>-<?php echo $config['name']; ?></title>
  9. <meta name="keywords" content="<?php echo $Articled['keyword']; ?>">
  10. <meta name="description" content="<?php echo $Articled['describe']; ?>">
  11. <link rel="stylesheet" href="static/font/iconfont.css">
  12. <link rel="stylesheet" href="static/css/article.css">
  13. </head>
  14. <body>
  15. <!--公共顶部导航区-->
  16. <header>
  17. <a href="">网站首页</a>
  18. <a href="">专题</a>
  19. <a href="">网站导航</a>
  20. <a href="">二手商品</a>
  21. <a href="">讨论区</a>
  22. <span><a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a><a href="">免费注册</a></span>
  23. </header>
  24. <div class="main">
  25. <div class="top">
  26. <img src="static/images/ar-logo.png" alt="">
  27. <a href="">财经</a>&gt;<span>正文</span>
  28. <label><input type="search"><span class="iconfont icon-sousuo2"></span></label>
  29. </div>
  30. <!-- 正文-->
  31. <article>
  32. <h1><?php echo $Articled['title']; ?></h1>
  33. <div>
  34. <span>发布时间:<?php echo date('Y-m-s h:i:s',$Articled['time']); ?></span>
  35. <span>来源:转发</span>
  36. <span>阅读量:<?php echo $Articled['browse']; ?></span>
  37. <span>评论数:99+</span>
  38. </div>
  39. <div>
  40. <?php echo $Articled['content']; ?>
  41. </div>
  42. </article>
  43. <!-- 右侧列表-->
  44. <div class="list1">
  45. <h3>网页评论</h3>
  46. <ul>
  47. <li><a href="">惠若琪 |坚持热爱,活成一束光,照亮自己</a></li>
  48. <li><a href="">小米公布6400万像素手机信息 1亿像素新品</a></li>
  49. <li><a href="">富士变焦镜皇 富士16-55 f/2.8售7490元</a></li>
  50. <li><a href="">惠若琪 |坚持热爱,活成一束光,照亮自己</a></li>
  51. <li><a href="">小米公布6400万像素手机信息 1亿像素新品</a></li>
  52. <li><a href="">富士变焦镜皇 富士16-55 f/2.8售7490元</a></li>
  53. </ul>
  54. </div>
  55. <div class="list2">
  56. <h3>网页评论</h3>
  57. <ul>
  58. <li><a href="">惠若琪 |坚持热爱,活成一束光,照亮自己</a></li>
  59. <li><a href="">小米公布6400万像素手机信息 1亿像素新品</a></li>
  60. <li><a href="">富士变焦镜皇 富士16-55 f/2.8售7490元</a></li>
  61. <li><a href="">惠若琪 |坚持热爱,活成一束光,照亮自己</a></li>
  62. <li><a href="">小米公布6400万像素手机信息 1亿像素新品</a></li>
  63. <li><a href="">富士变焦镜皇 富士16-55 f/2.8售7490元</a></li>
  64. </ul>
  65. </div>
  66. <div class="ding">
  67. <span></span>
  68. <span></span>
  69. </div>
  70. <div class="comment">
  71. <h3>网页评论</h3>
  72. <img src="static/images/user.png" alt="" width="60">
  73. <textarea name="" id="" cols="30" rows="10"></textarea>
  74. <button>发表评论</button>
  75. </div>
  76. <div class="recommend">
  77. <h3>推荐阅读</h3>
  78. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  79. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  80. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  81. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  82. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  83. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  84. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  85. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  86. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  87. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  88. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  89. <a href=""><img src="static/images/img1.jpg" alt="" width="195" height="130"></a>
  90. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  91. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  92. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  93. <a href="">惠若琪 |坚持热爱,活成一束光,照亮自己,成就更好的他</a>
  94. </div>
  95. </div>
  96. <!--页底部-->
  97. <footer>
  98. <div>
  99. <a href="">简介</a>
  100. <a href="">联系我们</a>
  101. <a href="">招聘信息</a>
  102. <a href="">友情链接</a>
  103. <a href="">用户服务协议</a>
  104. <a href="">隐私权声明</a>
  105. <a href="">法律投诉声明</a>
  106. </div>
  107. <div><span>LOGO</span></div>
  108. <div>
  109. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  110. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  111. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  112. </div>
  113. <div>
  114. <p>关注公众号</p>
  115. <img src="static/images/erwei-code.png" alt="">
  116. </div>
  117. </footer>
  118. </body>
  119. </html>

image-content.php:

  1. <?php
  2. require __DIR__ . '/centre/Container.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8">
  8. <title><?php echo $imgd['title']; ?>-<?php echo $config['name']; ?></title>
  9. <meta name="keywords" content="<?php echo $imgd['keyword']; ?>">
  10. <meta name="description" content="<?php echo $imgd['describe']; ?>">
  11. <link rel="stylesheet" href="static/font/iconfont.css">
  12. <link rel="stylesheet" href="static/css/image-content.css">
  13. </head>
  14. <body>
  15. <!--公共顶部导航区-->
  16. <header>
  17. <a href="">网站首页</a>
  18. <a href="">专题</a>
  19. <a href="">网站导航</a>
  20. <a href="">二手商品</a>
  21. <a href="">讨论区</a>
  22. <span><a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a><a href="">免费注册</a></span>
  23. </header>
  24. <div class="top">
  25. <h2>PHP中文网<span>图片站</span></h2>
  26. <label>
  27. <input type="search">
  28. <a href="" class="iconfont icon-jinduchaxun"></a>
  29. </label>
  30. </div>
  31. <div class="main">
  32. <div class="slider">
  33. <h2><?php echo $imgd['title']; ?></h2>
  34. <div class="show">
  35. <img src="<?php echo $imgd['content']; ?>" alt="" height="300">
  36. </div>
  37. </div>
  38. <!--评论复制文章详情页代码-->
  39. <div class="comment">
  40. <h3>网页评论</h3>
  41. <img src="static/images/user.png" alt="" width="60">
  42. <textarea name="" id="" cols="30" rows="10"></textarea>
  43. <button>发表评论</button>
  44. </div>
  45. <!-- 回复复制商城详情页-->
  46. <!-- 最新评论-->
  47. <div class="reply">
  48. <h3>最新评论</h3>
  49. <div>
  50. <img src="static/images/user.png" alt="" width="60" height="60">
  51. <span>用户昵称</span>
  52. <span>留言内容</span>
  53. <div>
  54. <span>2019-12-12 15:34:23发表</span>
  55. <span><i class="iconfont icon-dianzan"></i>回复</span>
  56. </div>
  57. </div>
  58. <div>
  59. <img src="static/images/user.png" alt="" width="60" height="60">
  60. <span>用户昵称</span>
  61. <span>留言内容</span>
  62. <div>
  63. <span>2019-12-12 15:34:23发表</span>
  64. <span><i class="iconfont icon-dianzan"></i>回复</span>
  65. </div>
  66. </div>
  67. <div>
  68. <img src="static/images/user.png" alt="" width="60" height="60">
  69. <span>用户昵称</span>
  70. <span>留言内容</span>
  71. <div>
  72. <span>2019-12-12 15:34:23发表</span>
  73. <span><i class="iconfont icon-dianzan"></i>回复</span>
  74. </div>
  75. </div>
  76. <div>
  77. <img src="static/images/user.png" alt="" width="60" height="60">
  78. <span>用户昵称</span>
  79. <span>留言内容</span>
  80. <div>
  81. <span>2019-12-12 15:34:23发表</span>
  82. <span><i class="iconfont icon-dianzan"></i>回复</span>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <!--页底部-->
  88. <footer>
  89. <div>
  90. <a href="">简介</a>
  91. <a href="">联系我们</a>
  92. <a href="">招聘信息</a>
  93. <a href="">友情链接</a>
  94. <a href="">用户服务协议</a>
  95. <a href="">隐私权声明</a>
  96. <a href="">法律投诉声明</a>
  97. </div>
  98. <div><span>LOGO</span></div>
  99. <div>
  100. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  101. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  102. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  103. </div>
  104. <div>
  105. <p>关注公众号</p>
  106. <img src="static/images/erwei-code.png" alt="">
  107. </div>
  108. </footer>
  109. </body>
  110. </html>

shop-content.php:

  1. <?php
  2. require __DIR__ . '/centre/Container.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8">
  8. <title><?php echo $shopd['title']; ?>-<?php echo $config['name']; ?></title>
  9. <meta name="keywords" content="<?php echo $shopd['keyword']; ?>">
  10. <meta name="description" content="<?php echo $shopd['describe']; ?>">
  11. <link rel="stylesheet" href="static/font/iconfont.css">
  12. <link rel="stylesheet" href="static/css/shop-content.css">
  13. </head>
  14. <body>
  15. <!--公共顶部导航区-->
  16. <header>
  17. <a href="">网站首页</a>
  18. <a href="">专题</a>
  19. <a href="">网站导航</a>
  20. <a href="">二手商品</a>
  21. <a href="">讨论区</a>
  22. <span><a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a><a href="">免费注册</a></span>
  23. </header>
  24. <!--logo+搜索框+快捷入口区-->
  25. <div class="logo">
  26. <img src="static/images/logo.png" alt="">
  27. <input type="search" id="search"><label for="search">搜索</label>
  28. <a href="">免费入驻</a>
  29. </div>
  30. <main>
  31. <!--导航-->
  32. <nav>
  33. <h3>所有产品分类 <span class="iconfont icon-liebiao"></span></h3>
  34. <a href="" class="active">首页</a>
  35. <a href="">3C</a>
  36. <a href="">生活用品</a>
  37. <a href="">名字名画</a>
  38. </nav>
  39. <!-- 商品展示-->
  40. <div class="goods">
  41. <div class="top-nav">
  42. <a href="">首页</a>-&gt;&gt;
  43. <a href="">3C数码</a>-&gt;&gt;
  44. <a href="">笔记本电脑</a>-&gt;&gt;
  45. </div>
  46. <img src="<?php echo $shopd['cover']; ?>" alt="">
  47. <h2><?php echo $shopd['title']; ?></h2>
  48. <p>本站特惠: <span>&yen;<?php echo $shopd['price']; ?></span></p>
  49. <p>
  50. 销量: <span><?php echo $shopd['sales']; ?></span>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  51. 累积评价: <span>3</span>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
  52. 好评率: <span>199%</span>
  53. </p>
  54. <p>
  55. <label for="num">购买数量:</label><input type="number" id="num" value="1">
  56. </p>
  57. <div>
  58. <button>立即购买</button>
  59. <button><i class="iconfont icon-icon_tianjia"></i>加入购物车</button>
  60. </div>
  61. <div>
  62. <span><i class="iconfont icon-zhanghaoquanxianguanli"></i>本站保障</span>
  63. <span><i class="iconfont icon-icon_safety"></i>企业认证</span>
  64. <span><i class="iconfont icon-tianshenpi"></i>退款承诺</span>
  65. <span><i class="iconfont icon-kuaisubianpai"></i>免费换货</span>
  66. </div>
  67. </div>
  68. <!-- 商品详情-->
  69. <div class="detail">
  70. <aside>
  71. <div><span>商品详情</span><span>案例演示</span></div>
  72. <div>
  73. <a href=""><img src="static/images/shop/shop1.jpg" alt=""></a>
  74. <a href="">美女美女性感写真海报墙面贴画艺</a>
  75. <div><span>热销:11</span><span>&yen;1299.00</span></div>
  76. </div>
  77. <div>
  78. <a href=""><img src="static/images/shop/shop2.jpg" alt=""></a>
  79. <a href="">美女美女性感写真海报墙面贴画艺</a>
  80. <div><span>热销:11</span><span>&yen;1299.00</span></div>
  81. </div>
  82. <div>
  83. <a href=""><img src="static/images/shop/shop2.jpg"></a>
  84. <a href="">美女美女性感写真海报墙面贴画艺</a>
  85. <div><span>热销:11</span><span>&yen;1299.00</span></div>
  86. </div>
  87. <div>
  88. <a href=""><img src="static/images/shop/shop4.jpg" alt=""></a>
  89. <a href="">美女美女性感写真海报墙面贴画艺</a>
  90. <div><span>热销:11</span><span>&yen;1299.00</span></div>
  91. </div>
  92. <div>
  93. <a href=""><img src="static/images/shop/shop5.jpg" alt=""></a>
  94. <a href="">美女美女性感写真海报墙面贴画艺</a>
  95. <div><span>热销:11</span><span>&yen;1299.00</span></div>
  96. </div>
  97. </aside>
  98. <article>
  99. <div class="nav">
  100. <a href="">商品详情</a>
  101. <a href="">案例/演示</a>
  102. <a href="">常见问题</a>
  103. <a href="">累计评价</a>
  104. <a href="">产品咨询</a>
  105. </div>
  106. <?php echo $shopd['content']; ?>
  107. <div class="comment">
  108. <h3>网页评论</h3>
  109. <img src="static/images/user.png" alt="" width="60">
  110. <textarea name="" id="" cols="30" rows="10"></textarea>
  111. <button>发表评论</button>
  112. </div>
  113. <!-- 最新评论-->
  114. <div>
  115. <h3>最新评论</h3>
  116. <div>
  117. <img src="static/images/user.png" alt="" width="60" height="60">
  118. <span>用户昵称</span>
  119. <span>留言内容</span>
  120. <div>
  121. <span>2019-12-12 15:34:23发表</span>
  122. <span><i class="iconfont icon-dianzan"></i>回复</span>
  123. </div>
  124. </div>
  125. <div>
  126. <img src="static/images/user.png" alt="" width="60" height="60">
  127. <span>用户昵称</span>
  128. <span>留言内容</span>
  129. <div>
  130. <span>2019-12-12 15:34:23发表</span>
  131. <span><i class="iconfont icon-dianzan"></i>回复</span>
  132. </div>
  133. </div>
  134. <div>
  135. <img src="static/images/user.png" alt="" width="60" height="60">
  136. <span>用户昵称</span>
  137. <span>留言内容</span>
  138. <div>
  139. <span>2019-12-12 15:34:23发表</span>
  140. <span><i class="iconfont icon-dianzan"></i>回复</span>
  141. </div>
  142. </div>
  143. <div>
  144. <img src="static/images/user.png" alt="" width="60" height="60">
  145. <span>用户昵称</span>
  146. <span>留言内容</span>
  147. <div>
  148. <span>2019-12-12 15:34:23发表</span>
  149. <span><i class="iconfont icon-dianzan"></i>回复</span>
  150. </div>
  151. </div>
  152. </div>
  153. </article>
  154. </div>
  155. </main>
  156. <!--页底部-->
  157. <footer>
  158. <div>
  159. <a href="">简介</a>
  160. <a href="">联系我们</a>
  161. <a href="">招聘信息</a>
  162. <a href="">友情链接</a>
  163. <a href="">用户服务协议</a>
  164. <a href="">隐私权声明</a>
  165. <a href="">法律投诉声明</a>
  166. </div>
  167. <div><span>LOGO</span></div>
  168. <div>
  169. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  170. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  171. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  172. </div>
  173. <div>
  174. <p>关注公众号</p>
  175. <img src="static/images/erwei-code.png" alt="">
  176. </div>
  177. </footer>
  178. </body>
  179. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议