Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- //check session is NOT (!) set
- if(!isset($_SESSION["loggedin"]))
- {
- //If so then go to location
- header("Location: login.php");
- }
- $hostname = "localhost";
- $username = "root";
- $password = "root";
- $Email = $_SESSION[('Email')];
- //connecting to the database
- $conn = mysqli_connect($hostname, $username, $password);
- mysqli_select_db($conn, "sammsproject") or die (mysqli_error($conn));
- $query1 = "SELECT * FROM customers WHERE 'Email' = '$Email'";
- $result1 = mysqli_query($conn, $query1)
- or die (mysqli_error($conn));
- $Email = mysqli_num_rows($result1);
- $query2 = "SELECT * FROM booking";
- $result2 = mysqli_query($conn, $query2)
- or die (mysqli_error($conn));
- $booking = mysqli_num_rows($result2);
- ?>
- <?php
- $query1 = '';
- while ($row = mysqli_fetch_array($result1))
- {
- $Name =$row['Name'];
- $Email = $row['Email'];
- }
- $query2 = '';
- while ($row = mysqli_fetch_array($result2))
- {
- $email= $row['email'];
- $date = $row['date'];
- $cut = $row['cut'];
- $colour = $row['colour'];
- $cost =$row['cost'];
- }
- echo "Welcome to your profile, '$Email'";
- echo "<div class=\"container\">";
- echo "<div class=\"header\">";
- echo "<a href=\"index.html\"><img src=\"Assets\Images\logo.png\"></a></img></div>";
- echo "<div class=\"separator\"> </div>";
- echo "<div class=\"customer\">
- <table>
- <tr>
- <th>Date of Appointment</th>
- <th>Cut</th>
- <th>Colour</th>
- <th>Cost</th>
- </tr>
- <tr>
- <td>
- $date
- </td>
- <td>
- $cut
- </td>
- <td>
- $colour
- </td>
- <td>
- $cost
- </td>
- </table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement