Advertisement
Guest User

tags.php

a guest
Oct 31st, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>Blog</title>
  5. <link rel="stylesheet" type="text/css" href="css/reset.css">
  6. <link rel="stylesheet" type="text/css" href="css/index.css">
  7. <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
  8. <link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>
  9. <link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
  10. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  11. <script>
  12. $(document).ready(function(){
  13. $("#flip").click(function(){
  14. $("#panel").slideToggle("slow");
  15. });
  16. });
  17. </script>
  18. </head>
  19. <body>
  20. <div class="headblock">
  21. <div class="littlehead">Blog</br>________</div>
  22. <ul class="menu-list" ><div id="flip"> <img src="list.png" style="width:48px;height:48px">
  23. <div id="panel"><li><span class="login"><a href="includes/logout.php" class="login-link">Log out</a></li></span></div>
  24. </ul></div>
  25. <div id="container">
  26. <div class="topbar">
  27. <span class="menu menu-active" onclick="location.href='home.php'">Home</span>
  28.  
  29. <?php
  30. include "mysql.php";
  31. $query = $mysqli->query("SELECT * FROM category");
  32. while($getdata = $query->fetch_assoc()) {
  33. echo "&nbsp;&nbsp;|&nbsp;&nbsp;";
  34. echo '<span class="menu" onclick="' . "location.href='category.php?id=" . $getdata["id"] . "'" . '">' . $getdata["name"] . '</span>';
  35. }
  36. ?>
  37. </div>
  38. <div class="content">
  39. <?php
  40. $tags = $_GET["tags"];
  41. if($tags == NULL) {
  42. echo "<script>location.href='add.php';</script>";
  43. }
  44. $query = $mysqli->query("SELECT * FROM post WHERE tags LIKE '%$tags,%' ORDER by id DESC");
  45. while($getdata = $query->fetch_assoc()) {
  46. $newtags = "";
  47. $tags = split(",", $getdata["tags"]);
  48. foreach ($tags as $value) {
  49. $newtags .= '<a href="tags.php?tags=' . $value . '">' . $value . '</a>&nbsp;';
  50. }
  51. ?>
  52. <div class="post">
  53. <p>
  54. <div><h5><font size="5" ><a href="post.php?id=<?php echo $getdata["id"]; ?>"><?php echo $getdata["title"]; ?></a></h5></font></div>
  55. <div><small>tags: <i><?php echo $newtags; ?></i></small></div>
  56. </p>
  57. <p style="margin-top: 20px;">
  58. <?php echo $getdata["detail"]; ?>
  59. </p>
  60. <p style="margin-top: 20px;"><font size="3" color="red">
  61. <small><i>Posted by <?php echo $getdata["username"]; ?></i></small>
  62. <div style="margin-top: 5px;"><small><i><?php echo $data["time"]; ?></i></small></div>
  63.  
  64. </p></font>
  65. </div>
  66.  
  67. <?php
  68. }
  69. ?>
  70. </div>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement