Advertisement
Guest User

Untitled

a guest
May 22nd, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 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.  
  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="home.php">Home</a></li>
  26. <li><a href="register.php">Register</a></li>
  27. </ul>
  28. </nav>
  29. <div id="main">
  30. <p>Dear customer
  31. To indulge in our wonderful pizza online system please register
  32. filling in the relevant information below and click the register button.
  33. </p>
  34. <form method="post" action="<?php $_PHP_SELF ?>">
  35. Name:<input type="text" name="name"><br>
  36. Surname:<input type="text" name="surname"><br>
  37. Address:<input type="text" name="address"><br>
  38. Phone No:<input type="text" name="phone"><br>
  39. Email:<input type="text" name="email"><br>
  40. Username:<input type="text" name="user"><br>
  41. Password:<input type="password" name="pass"><br>
  42. <input type="submit" name="register" id="register" value="Register Details">
  43. </form>
  44. <?php
  45. if(isset($_POST['register']))
  46. {
  47. $servername = "localhost";
  48. $username = "root";
  49. $password = "";
  50. $dbname = "senseipizza";
  51.  
  52. // Create connection
  53. $conn = mysqli_connect($servername, $username, $password, $dbname);
  54. // Check connection
  55. if (!$conn) {
  56. die("Connection failed: " . $conn->connect_error);
  57. }
  58. $custName = $_POST['name'];
  59. $custSurname = $_POST['surname'];
  60. $custPhone = $_POST['phone'];
  61. $custAddress = $_POST['address'];
  62. $custEmail = $_POST['email'];
  63. $custUser = $_POST['user'];
  64. $custPass = $_POST['pass'];
  65.  
  66. $sql = "INSERT INTO customer (customerID, customerName, customerSurname, customerPhone,
  67. customerAddress, customerEmail, customerUsername, customerPassword)
  68. VALUES
  69. ('10''$custName','$custSurname','$custPhone','$custAddress','$custEmail','$custUser','$custPass')";
  70. if ($conn->query($sql) === TRUE) {
  71. echo "New record created successfully";
  72. } else {
  73. echo "<p>Error: " . $sql . "<br>" . $conn->error . "</p>";
  74. }
  75.  
  76. mysqli_close($conn);
  77. }
  78. ?>
  79. </div>
  80. </div>
  81.  
  82. <footer>
  83. <p> Sensei Pizza is a pizza registered restaurant and copywrited by the unifications act of the United States &#169; 2016 </p>
  84. </footer>
  85. </div>
  86. </body>
  87. <?php
  88.  
  89. ?>
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement