Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!isset($_SESSION['login'])) {
- header('location: index.php');
- }
- ?>
- <!doctype html>
- <html lang = "pl">
- <head>
- <link rel = "stylesheet" type = "text/css" href = "styl.css">
- <meta charset = "utf-8">
- </head>
- <body>
- <div id = "baner">
- <h1>Contact Manager</h1>
- </div>
- <div id = "left">
- <h2>Menu</h2>
- <a href = ""><li>przeglądaj</li></a>
- <a href = ""><li>dodaj</li></a>
- <a href = ""><li>usun</li></a>
- <a href = ""><li>wyloguj</li></a>
- </div>
- <div id = "right">
- <?php
- $servername = 'localhost';
- $username = 'root';
- $password = '';
- $database = 'cm';
- $connect = mysqli_connect($servername, $username, $password, $database);
- if ($connect) {
- $zapytanie = "select * from kontakty";
- $query = mysqli_query($connect, $zapytanie);
- echo '<table>';
- echo '<tr>';
- echo "<th>id_kontaktu</th><th>telefon</th><th>imie</th><th>nazwisko</th><th>e-mail</th>";
- echo '</tr>';
- while($row = mysqli_fetch_array($query)) {
- echo '<tr>';
- echo "<td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td>";
- echo'</tr>';
- }
- echo '</table>';
- }
- ?>
- <div id = "log">
- </div>
- </div>
- <div id = "footer">
- <p>©2018</p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement