Guest User

Untitled

a guest
Nov 27th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2. include 'header.php';
  3. include 'menu.php';
  4. ?>
  5. <?php
  6. session_start();
  7. session_destroy();
  8. if(isset($_SESSION["firstName"])&&isset($_SESSION["lastName"])&&isset($_SESSION["emailAddress"])&&isset($_SESSION["phoneNum"])&&isset($_SESSION["socialNumber"])&&isset($_SESSION["password"])){
  9. echo "<h1>Session State Data</h1>";
  10. echo "First Name: " .$_SESSION["firstName"]."</br>";
  11. echo "Last Name: ".$_SESSION["lastName"]."</br>";
  12. echo "Email Address: ".$_SESSION["emailAddress"]."</br>";
  13. echo "Phone Number: ".$_SESSION["phoneNum"]."</br>";
  14. echo "SIN: ".$_SESSION["socialNumber"]."</br>";
  15. echo "Password: ".$_SESSION["password"]."</br>";
  16. }
  17. $host = "localhost";
  18. $database = "peterngu_cst8238";
  19. $username = "peterngu_account";
  20. $password = "44126841";
  21. $dbConnection = mysql_connect($host, $username, $password);
  22. if(!$dbConnection){
  23. die("Unable to connect to database ". $host.mysql_connect_error($dbConnection));
  24. }
  25. mysql_select_db($database);
  26. $sql = "SELECT * FROM employee";
  27. $data = mysql_query($sql);
  28. echo "<h1>Database Data</h1>";
  29. echo "<table>
  30. <tr>
  31. <td><b>First Name</b></td>
  32. <td><b>Last Name</b></td>
  33. <td><b>Email Address</b></td>
  34. <td><b>Phone Number</b></td>
  35. <td><b>SIN</b></td>
  36. <td><b>Password</b></td>
  37. </tr>";
  38. while($record = mysql_fetch_array($data)){
  39. echo "<tr>";
  40. echo "<td>" .$record['firstName'] . "</td>";
  41. echo "<td>" .$record['lastName'] . "</td>";
  42. echo "<td>" .$record['emailAddress'] . "</td>";
  43. echo "<td>" .$record['phoneNum'] . "</td>";
  44. echo "<td>" .$record['socialNumber'] . "</td>";
  45. echo "<td>" .$record['password'] . "</td>";
  46. echo "</tr>";
  47. echo "</br>";
  48. }
  49. echo"</table>";
  50. mysql_close($dbConnection);
  51. ?>
  52. <html>
  53. </html>
  54. <?php
  55. include 'footer.php';
  56. ?>
Add Comment
Please, Sign In to add comment