Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "lucasrbh_lucas";
- $password = "lucasredmond";
- $dbname = "lucasrbh_blog";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Contact V2</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!--===============================================================================================-->
- <link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
- <!--===============================================================================================-->
- <link rel="stylesheet" type="text/css" href="css/util.css">
- <link rel="stylesheet" type="text/css" href="css/main.css">
- <!--===============================================================================================-->
- </head>
- <body>
- <div class="bg-contact2" style="background-image: url('images/bg-01.jpg');">
- <a style="margin-left: 10px;" href="https://showerthoughtspodcast.com/blog/">Home</a>
- <div class="container-contact2">
- <div class="wrap-contact2">
- <?php
- $sql = "SELECT `ID`,`Username`,`Title` FROM `Posts` LIMIT 10";
- $result = $conn->query($sql);
- echo"<h1><b>Posts<b></h1><br>";
- echo"<hr>";
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- $id = $row["ID"];
- echo $row['Title']." ";
- echo " "." <small> by " . $row["Username"]."</small> :";
- echo " "."<a href='https://showerthoughtspodcast.com/blog/post?id=$id'> View Here </a>";
- echo "<br>";
- echo"<hr>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- <br> <a href = "https://showerthoughtspodcast.com/blog/viewall.php">View All</a>
- </div>
- </div>
- </div>
- <!--===============================================================================================-->
- <script src="vendor/jquery/jquery-3.2.1.min.js"></script>
- <!--===============================================================================================-->
- <script src="vendor/bootstrap/js/popper.js"></script>
- <script src="vendor/bootstrap/js/bootstrap.min.js"></script>
- <!--===============================================================================================-->
- <script src="vendor/select2/select2.min.js"></script>
- <!--===============================================================================================-->
- <script src="js/main.js"></script>
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-23581568-13"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'UA-23581568-13');
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement