Advertisement
Guest User

Untitled

a guest
May 29th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. <!DOCTYPE>
  2. <html>
  3. <head>
  4. <link href="CSS/web.css" type="text/css" rel="stylesheet" >
  5. </head>
  6. <body>
  7. <?php
  8. session_start();
  9. ?>
  10. <div id="content">
  11. <div id="header">
  12. <img src="Pictures/senseiPizza.jpg" alt="Logo" width="100" height="90">
  13. <h1>Sensei Pizza</h1>
  14. <div class="address">
  15. <h2>Restaurant Location:</h2>
  16. <span>28 Sewer Street, (Shredder Town) New York</span>
  17. </div>
  18. </div>
  19. <div class="motto">
  20. <h3>Sensei Pizza will fufill its mission ... to feed you.</h3>
  21. </div>
  22. <div class="subContent">
  23. <nav>
  24. <ul>
  25. <li><a href="custhome.php">Home</a></li>
  26. <li><a href="profile.php">Profile</a></li>
  27. <li><a href="logout.php">Logout</a></li>
  28. </ul>
  29. </nav>
  30. <div id="main">
  31. <p>Dear customer
  32. To indulge in our wonderful pizza online system please register
  33. filling in the relevant information below and click the register button.
  34. </p>
  35. <form method="post" action="<?php $_PHP_SELF ?>">
  36. Name:<input type="text" name="name"><br>
  37. Surname:<input type="text" name="surname"><br>
  38. Address:<input type="text" name="address"><br>
  39. Phone No:<input type="text" name="phone"><br>
  40. Email:<input type="text" name="email"><br>
  41. <input type="submit" name="update" id="update" value="Update Details">
  42. </form>
  43. <?php
  44. if(isset($_POST['update']))
  45. {
  46. $servername = "localhost";
  47. $username = "root";
  48. $password = "";
  49. $dbname = "senseipizza";
  50.  
  51. // Create connection
  52. $conn = mysqli_connect($servername, $username, $password, $dbname);
  53. // Check connection
  54. if (!$conn) {
  55. die("Connection failed: " . $conn->connect_error);
  56. }
  57. $name = $_POST['name'];
  58. $surname = $_POST['surname'];
  59. $phone = $_POST['phone'];
  60. $address = $_POST['address'];
  61. $email = $_POST['email'];
  62. $ID = $_SESSION["customerID"];
  63. $sql = "UPDATE customer SET customerName=$name, customerSurname=$surname
  64. , customerPhone=$phone, customerAddress=$address
  65. , customerEmail=$email WHERE customerID=$ID";
  66.  
  67. if ($conn->query($sql) === TRUE) {
  68. echo "Your details have been updated";
  69. } else {
  70. echo "There has been an error recording your details: " . $conn->error;
  71. }
  72.  
  73. mysqli_close($conn);
  74. }
  75. ?>
  76. </div>
  77. </div>
  78.  
  79. <footer>
  80. <p> Sensei Pizza is a pizza registered restaurant and copywrited by the unifications act of the United States &#169; 2016 </p>
  81. </footer>
  82. </div>
  83. </body>
  84. <?php
  85.  
  86. ?>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement