Advertisement
Guest User

Untitled

a guest
Feb 1st, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "lucasrbh_lucas";
  4. $password = "lucasredmond";
  5. $dbname = "lucasrbh_blog";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. ?>
  15.  
  16. <!DOCTYPE html>
  17. <html lang="en">
  18. <head>
  19. <title>Contact V2</title>
  20. <meta charset="UTF-8">
  21. <meta name="viewport" content="width=device-width, initial-scale=1">
  22. <!--===============================================================================================-->
  23. <link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
  24. <!--===============================================================================================-->
  25. <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
  26. <!--===============================================================================================-->
  27. <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
  28. <!--===============================================================================================-->
  29. <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
  30. <!--===============================================================================================-->
  31. <link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
  32. <!--===============================================================================================-->
  33. <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
  34. <!--===============================================================================================-->
  35. <link rel="stylesheet" type="text/css" href="css/util.css">
  36. <link rel="stylesheet" type="text/css" href="css/main.css">
  37. <!--===============================================================================================-->
  38. </head>
  39. <body>
  40. <div class="bg-contact2" style="background-image: url('images/bg-01.jpg');">
  41. <a style="margin-left: 10px;" href="https://showerthoughtspodcast.com/blog/">Home</a>
  42. <div class="container-contact2">
  43. <div class="wrap-contact2">
  44. <?php
  45.  
  46. $sql = "SELECT `ID`,`Username`,`Title` FROM `Posts` LIMIT 10";
  47. $result = $conn->query($sql);
  48. echo"<h1><b>Posts<b></h1><br>";
  49. echo"<hr>";
  50. if ($result->num_rows > 0) {
  51. // output data of each row
  52. while($row = $result->fetch_assoc()) {
  53. $id = $row["ID"];
  54. echo $row['Title']." ";
  55. echo " "." <small> by " . $row["Username"]."</small> :";
  56. echo " "."<a href='https://showerthoughtspodcast.com/blog/post?id=$id'> View Here </a>";
  57. echo "<br>";
  58. echo"<hr>";
  59. }
  60. } else {
  61. echo "0 results";
  62. }
  63. $conn->close();
  64.  
  65.  
  66. ?>
  67. <br> <a href = "https://showerthoughtspodcast.com/blog/viewall.php">View All</a>
  68. </div>
  69. </div>
  70. </div>
  71.  
  72.  
  73.  
  74.  
  75. <!--===============================================================================================-->
  76. <script src="vendor/jquery/jquery-3.2.1.min.js"></script>
  77. <!--===============================================================================================-->
  78. <script src="vendor/bootstrap/js/popper.js"></script>
  79. <script src="vendor/bootstrap/js/bootstrap.min.js"></script>
  80. <!--===============================================================================================-->
  81. <script src="vendor/select2/select2.min.js"></script>
  82. <!--===============================================================================================-->
  83. <script src="js/main.js"></script>
  84.  
  85. <!-- Global site tag (gtag.js) - Google Analytics -->
  86. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-23581568-13"></script>
  87. <script>
  88. window.dataLayer = window.dataLayer || [];
  89. function gtag(){dataLayer.push(arguments);}
  90. gtag('js', new Date());
  91.  
  92. gtag('config', 'UA-23581568-13');
  93. </script>
  94.  
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement