Advertisement
Guest User

Untitled

a guest
May 17th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <?php
  2. session_start();
  3. //check session is NOT (!) set
  4. if(!isset($_SESSION["loggedin"]))
  5. {
  6. //If so then go to location
  7. header("Location: login.php");
  8. }
  9.  
  10. $hostname = "localhost";
  11. $username = "root";
  12. $password = "root";
  13. $Email = $_SESSION[('Email')];
  14.  
  15.  
  16. //connecting to the database
  17. $conn = mysqli_connect($hostname, $username, $password);
  18. mysqli_select_db($conn, "sammsproject") or die (mysqli_error($conn));
  19.  
  20. $query1 = "SELECT * FROM customers WHERE 'Email' = '$Email'";
  21.  
  22. $result1 = mysqli_query($conn, $query1)
  23. or die (mysqli_error($conn));
  24. $Email = mysqli_num_rows($result1);
  25.  
  26. $query2 = "SELECT * FROM booking";
  27.  
  28. $result2 = mysqli_query($conn, $query2)
  29. or die (mysqli_error($conn));
  30. $booking = mysqli_num_rows($result2);
  31. ?>
  32.  
  33. <?php
  34.  
  35.  
  36.  
  37. $query1 = '';
  38. while ($row = mysqli_fetch_array($result1))
  39. {
  40. $Name =$row['Name'];
  41. $Email = $row['Email'];
  42. }
  43. $query2 = '';
  44. while ($row = mysqli_fetch_array($result2))
  45. {
  46. $email= $row['email'];
  47. $date = $row['date'];
  48. $cut = $row['cut'];
  49. $colour = $row['colour'];
  50. $cost =$row['cost'];
  51. }
  52.  
  53. echo "Welcome to your profile, '$Email'";
  54. echo "<div class=\"container\">";
  55. echo "<div class=\"header\">";
  56. echo "<a href=\"index.html\"><img src=\"Assets\Images\logo.png\"></a></img></div>";
  57. echo "<div class=\"separator\">&nbsp;</div>";
  58. echo "<div class=\"customer\">
  59. <table>
  60. <tr>
  61. <th>Date of Appointment</th>
  62. <th>Cut</th>
  63. <th>Colour</th>
  64. <th>Cost</th>
  65. </tr>
  66. <tr>
  67. <td>
  68. $date
  69. </td>
  70. <td>
  71. $cut
  72. </td>
  73. <td>
  74. $colour
  75. </td>
  76. <td>
  77. $cost
  78. </td>
  79. </table>";
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement