Advertisement
Guest User

Untitled

a guest
Oct 31st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (!isset($_SESSION['login'])) {
  4. header('location: index.php');
  5. }
  6. ?>
  7. <!doctype html>
  8. <html lang = "pl">
  9. <head>
  10. <link rel = "stylesheet" type = "text/css" href = "styl.css">
  11. <meta charset = "utf-8">
  12. </head>
  13. <body>
  14. <div id = "baner">
  15. <h1>Contact Manager</h1>
  16. </div>
  17. <div id = "left">
  18. <h2>Menu</h2>
  19. <a href = ""><li>przeglądaj</li></a>
  20. <a href = ""><li>dodaj</li></a>
  21. <a href = ""><li>usun</li></a>
  22. <a href = ""><li>wyloguj</li></a>
  23. </div>
  24. <div id = "right">
  25. <?php
  26. $servername = 'localhost';
  27. $username = 'root';
  28. $password = '';
  29. $database = 'cm';
  30. $connect = mysqli_connect($servername, $username, $password, $database);
  31. if ($connect) {
  32. $zapytanie = "select * from kontakty";
  33. $query = mysqli_query($connect, $zapytanie);
  34. echo '<table>';
  35. echo '<tr>';
  36. echo "<th>id_kontaktu</th><th>telefon</th><th>imie</th><th>nazwisko</th><th>e-mail</th>";
  37. echo '</tr>';
  38. while($row = mysqli_fetch_array($query)) {
  39. echo '<tr>';
  40. echo "<td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td>";
  41. echo'</tr>';
  42.  
  43.  
  44.  
  45.  
  46. }
  47. echo '</table>';
  48.  
  49.  
  50. }
  51.  
  52. ?>
  53. <div id = "log">
  54.  
  55.  
  56. </div>
  57. </div>
  58. <div id = "footer">
  59. <p>&copy;2018</p>
  60. </div>
  61.  
  62.  
  63. </body>
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement