SHARE
TWEET

index.php

a guest Feb 27th, 2019 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $servername = "127.0.0.1";
  3. $dbname = "neridaar";
  4. $username = "ID";
  5. $password = "MDP";
  6.  
  7.     $bdd = new PDO("mysql:host=$servername;port=3306;dbname=$dbname; charset=utf8", $username, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
  8.     $articles = $bdd->query('SELECT * FROM articles ORDER BY date_time_publication DESC');
  9.  
  10. ?>
  11.  
  12. <!DOCTYPE html>
  13. <html lang="fr">
  14. <head>
  15.     <meta charset="UTF-8">
  16.     <title>Site Neridaar</title>
  17.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  18.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  19.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
  20.     <link rel="stylesheet" href="../css/styles.css">
  21. </head>
  22. <body>
  23.     <nav class="navbar navbar-expand-md bg-dark navbar-dark sticky-top">
  24.       <a class="navbar-brand" href="#">Neridaar</a>
  25.       <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navb" aria-expanded="true">
  26.         <span class="navbar-toggler-icon"></span>
  27.       </button>
  28.       <div id="navb" class="navbar-collapse collapse hide">
  29.         <ul class="navbar-nav">
  30.           <li class="nav-item active">
  31.             <a class="nav-link" href="../html/index.php">Accueil</a>
  32.           </li>
  33.           <li class="nav-item">
  34.             <a class="nav-link" href="../html/autre.php">Autre</a>
  35.           </li>
  36.           <li class="nav-item">
  37.             <a class="nav-link" href="../html/article.php">Article</a>
  38.           </li>
  39.         </ul>
  40.  
  41.         <ul class="nav navbar-nav ml-auto">
  42.           <li class="nav-item">
  43.             <a class="nav-link" href="../html/connexion.php"><span class="fas fa-sign-in-alt"></span> Login</a>
  44.           </li>
  45.         </ul>
  46.       </div>
  47.     </nav>
  48.  
  49.  
  50. <ul>
  51.       <?php while($a = $articles->fetch()) { ?>
  52.       <li><a href="article.php?id=<?= $a['id'] ?>"><?= $a['titre'] ?></a></li>
  53.       <?php } ?>
  54. </ul>
  55.  
  56.  
  57.  
  58.  
  59. </body>
  60. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top