Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. //Include database
  3. include_once 'classes/db.php';
  4.  
  5. $stmt = $con->prepare("SELECT * FROM articles");
  6. $stmt->execute();
  7.  
  8. $call = $stmt->fetchAll(PDO::FETCH_ASSOC);
  9.  
  10. ?>
  11.  
  12. <!DOCTYPE html>
  13. <html lang="en" style="width: 100%; height: 100%;">
  14. <head>
  15.     <meta charset="utf-8">
  16.     <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400' rel='stylesheet' type='text/css'>
  17.     <title></title>
  18. </head>
  19. <body style="background: #fff;">
  20.     <center>
  21.         <h1 style="
  22.         font-family:Lato-Hairline;font-size:55px;color:#000000;line-height:48px;font-weight:lighter;padding: 20px;margin-bottom: 20px;width:200px;border-bottom:1px solid #efefef;
  23.         ">Test</h1>
  24.  
  25.         <?php
  26.         foreach ($call as $key) {
  27.             $title = $key['title'];
  28.             $id = $key['id'];
  29.             $from = $key['from'];
  30.             ?>
  31.             <h2 style="padding: 20px;"><a href="http://localhost/article/<?php echo $id; ?>" style="font-family: Lato-Hairline;
  32.                 font-size: 32px;
  33.                 color: #000000;
  34.                 line-height: 27px;
  35.                 text-decoration: none;
  36.                 font-weight: lighter;
  37.                 ">
  38.                 <?php echo $from; ?> - <?php echo $title ?>
  39.             </a></h2>
  40.             <?php
  41.         }
  42.         ?>
  43.     </center>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement