Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Include database
- include_once 'classes/db.php';
- $stmt = $con->prepare("SELECT * FROM articles");
- $stmt->execute();
- $call = $stmt->fetchAll(PDO::FETCH_ASSOC);
- ?>
- <!DOCTYPE html>
- <html lang="en" style="width: 100%; height: 100%;">
- <head>
- <meta charset="utf-8">
- <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400' rel='stylesheet' type='text/css'>
- <title></title>
- </head>
- <body style="background: #fff;">
- <center>
- <h1 style="
- 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;
- ">Test</h1>
- <?php
- foreach ($call as $key) {
- $title = $key['title'];
- $id = $key['id'];
- $from = $key['from'];
- ?>
- <h2 style="padding: 20px;"><a href="http://localhost/article/<?php echo $id; ?>" style="font-family: Lato-Hairline;
- font-size: 32px;
- color: #000000;
- line-height: 27px;
- text-decoration: none;
- font-weight: lighter;
- ">
- <?php echo $from; ?> - <?php echo $title ?>
- </a></h2>
- <?php
- }
- ?>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement