Advertisement
Guest User

Untitled

a guest
Mar 7th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.25 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.  
  6. <title>Site Beta Signed List</title>
  7.  
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9.  
  10. <link rel="stylesheet" href="style.css" type="text/css" />
  11.  
  12. </head>
  13.  
  14. <body>
  15.  
  16. <div id="outer">
  17.  
  18. <div id="wrap">
  19.  
  20. <div id="title">List of people signed in already</div>
  21.  
  22. <div id="header"></div>
  23.  
  24. <div class ="content">
  25.  
  26. <h1>List of people signed in so far: </h1>
  27.  
  28. <br>
  29.  <?php
  30.        $db = pg_connect('host=localhost dbname=database user=dzwiedziu password=power5');
  31.  
  32.        $query = "SELECT * FROM users";
  33.  
  34.        $result = pg_query($query);
  35.        if (!$result) {
  36.            echo "Problem with query " . $query . "<br/>";
  37.             echo pg_last_error();
  38.             exit();
  39.         }
  40.  
  41.         while($myrow = pg_fetch_assoc($result)) {
  42.             printf ("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", $myrow['id'], htmlspecialchars($myrow['firstname']), htmlspecialchars($myrow['lastname']), htmlspecialchars($myrow['email']));
  43.         }
  44.         ?>
  45. <br>
  46.  
  47. <form action="index.html">
  48.     <input type="submit" value="Go back to sign in!">
  49. </form>
  50.  
  51. <br>
  52. <div id="footer">
  53.    
  54.  
  55.    
  56. Michał Tulejko 2016
  57.    
  58.     </div>
  59.  
  60.  
  61. </div>
  62.  
  63. </body>
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement