Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 KB | None | 0 0
  1. <?php include 'database.php'; ?>
  2. <?php
  3.     //Create Select Query
  4.     $query = "SELECT * FROM shouts ORDER BY id DESC";
  5.     $shouts = mysqli_query($con ,$query);
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9.     <head>
  10.         <meta charset="utf-8"/>
  11.         <title>SHOUT IT!</title>
  12.         <link rel="stylesheet" href="css/css.css"/>
  13.     </head>
  14.     <body>
  15.         <div id="container">
  16.             <header><h1>SHOUT IT!</h1></header>
  17.             <div id="shouts">
  18.             <ul>
  19.                 <?php while($row = mysqli_fetch_assoc($shouts)) : ?>
  20.                 <li class="shouts"><span><?php echo $row['time'] ?> </span><strong> <?php echo $row['user'] ?></strong>: <?php echo $row['message'] ?> </li>
  21.                 <?php endwhile; ?>
  22.             </ul>
  23.         </div>
  24.             <div id="input">
  25.                 <?php if(isset($_GET['error'])): ?>
  26.                     <div class="error"><?php echo $_GET['error']; ?></div>
  27.                 <?php endif; ?>
  28.             <form method="post" action="process.php">
  29.                 <input type="text" name="user" placeholder="Enter Your Name" />
  30.                 <input type="text" name="message" placeholder="Enter a Message" />
  31.                 <br/>
  32.                 <input class="shout-btn" type="submit" name="submit" value="Shout It Out" />
  33.             </form>
  34.         </div>
  35.         </div>    
  36.     </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement