Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "OOF";
- $username = "OOF";
- $password = "OOF";
- $dbname = "OOF";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM Posts ORDER BY Id DESC ";
- $result = $conn->query($sql);
- ?>
- <html lang="en">
- <head>
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-113502571-1"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'UA-113502571-1');
- </script>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="">
- <meta name="author" content="">
- <link rel="icon" href="images/logo.png" type="image/x-icon"/>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>The Garlic Press</title>
- <!-- Bootstrap core CSS -->
- <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
- <!-- Custom styles for this template -->
- <link href="css/blog-home.css" rel="stylesheet">
- </head>
- <body>
- <!-- Navigation -->
- <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
- <div class="container">
- <img src="images/biglogo.png" width="50px" height="50px" style="padding-rght: 20px;">
- <a class="navbar-brand" href="index.php"> The Garlic Press</a>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarResponsive">
- <ul class="navbar-nav ml-auto">
- <li class="nav-item active">
- <a class="nav-link" href="#">Home
- <span class="sr-only">(current)</span>
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="https://www.grlc.press/page.php?id=1">About</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="contact.php">Contact</a>
- </li>
- </ul>
- </div>
- </div>
- </nav>
- <!-- Page Content -->
- <div class="container">
- <div class="row">
- <!-- Blog Entries Column -->
- <div class="col-md-8">
- <h1 class="my-4">Current News
- <small>For Current People</small>
- </h1>
- <!-- Blog Post -->
- <?php
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo '<div class="card mb-4">';
- echo '<img class="img-fluid rounded" src="' . $row["Image"] . '" alt="">';
- echo '<div class="card-body">';
- echo '<h2 class="card-title">' . $row["Title"] .'</h2>';
- echo '<p class="card-text">' . substr($row["Post"], 0, 200) . '...' .'</p>';
- echo '<a href="page.php?id='. $row["Id"] . '" class="btn btn-primary">Read More →</a>';
- echo '</div>';
- echo '<div class="card-footer text-muted">';
- echo 'Posted on '. $row["Date"] .' by ';
- echo '<a href="#">' . $row["Author"] . '</a>';
- echo '</div>';
- echo '</div>';
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- <!-- Pagination -->
- <ul class="pagination justify-content-center mb-4">
- <li class="page-item">
- <a class="page-link" href="#">← Older</a>
- </li>
- <li class="page-item disabled">
- <a class="page-link" href="#">Newer →</a>
- </li>
- </ul>
- </div>
- <!-- Sidebar Widgets Column -->
- <div class="col-md-4">
- <!-- Side Widget -->
- <?php include('price.php') ?>
- <?php include('ad.php') ?>
- </div>
- </div>
- <!-- /.row -->
- </div>
- <!-- /.container -->
- <!-- Footer -->
- <footer class="py-5 bg-dark">
- <div class="container">
- <p class="m-0 text-center text-white">Copyright © grlc.press 2018</p>
- </div>
- <!-- /.container -->
- </footer>
- <!-- Bootstrap core JavaScript -->
- <script src="vendor/jquery/jquery.min.js"></script>
- <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement