Advertisement
Guest User

Bai tap 17-84 mysql

a guest
Aug 27th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <meta charset="utf-8">
  4.     <title>Hoctudau.com</title>
  5.     <link rel="stylesheet" type="text/css" href=style.css>
  6.   </head>
  7.   <body>
  8.       <div class="wrapper">
  9.       <div class="header">
  10.         <h1>Trung tâm đào tạo: hoctudau.com</h1>
  11.       </div>
  12.       <?php include ("functions.smart.php");
  13.       ob_start();
  14.       ?>
  15.       <div class="nav">
  16.         <ul id="nav">
  17.           <li><a href="index.php">Trang chủ</a></li>
  18.           <li><a href="?cat=thong-bao">Thông báo</a></li>
  19.           <li><a href="?cat=tuyen-dung">Tuyển dụng</a></li>
  20.           <li><a href="?cat=nhan-xet">Nhận xét</a></li>
  21.         </ul>
  22.       </div>
  23.      <?php
  24.         nav_smart(ob_get_clean(),'class="active"');
  25.        ?>
  26.       <div class="contents">
  27.     <?php
  28.         mysql_connect('localhost','u426615682_hung2','hung123');
  29.         mysql_query("SET character_set_results=utf8");
  30.         mysql_select_db('u426615682_bt84');
  31.         $r=mysql_query("SELECT id,title,content,category FROM data");
  32.         while ($row=mysql_fetch_array($r)) {
  33.         if (@$_GET['cat']==$row['category']
  34.          || @$_GET['p']==$row['id']
  35.          || (@!$_GET['cat']&&@!$_GET['p'])
  36.          ) {
  37.         ?>
  38.            <h3>
  39.             <a href="?p=<?php echo $row['id'];?>">
  40.             <?php echo $row['title'];?>
  41.             </a>
  42.             </h3>
  43.             <p> <?php echo $row['content'];?></p>
  44.     <?php    
  45.          }
  46.         }
  47.     ?>
  48. </div>
  49.       <div class="footer">
  50.         Copyright 2014, hoctudau.com
  51.       </div>
  52.     </div>
  53.  
  54.  
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement