Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE>
- <html>
- <head>
- <link href="CSS/web.css" type="text/css" rel="stylesheet" >
- </head>
- <body>
- <?php
- ?>
- <div id="content">
- <div id="header">
- <img src="Pictures/senseiPizza.jpg" alt="Logo" width="100" height="90">
- <h1>Sensei Pizza</h1>
- <div class="address">
- <h2>Restaurant Location:</h2>
- <span>28 Sewer Street, (Shredder Town) New York</span>
- </div>
- </div>
- <div class="motto">
- <h3>Sensei Pizza will fufill its mission ... to feed you.</h3>
- </div>
- <div class="subContent">
- <nav>
- <ul>
- <li><a href="home.php">Home</a></li>
- <li><a href="register.php">Register</a></li>
- </ul>
- </nav>
- <div id="main">
- <p>Dear customer
- To indulge in our wonderful pizza online system please register
- filling in the relevant information below and click the register button.
- </p>
- <form method="post" action="<?php $_PHP_SELF ?>">
- Name:<input type="text" name="name"><br>
- Surname:<input type="text" name="surname"><br>
- Address:<input type="text" name="address"><br>
- Phone No:<input type="text" name="phone"><br>
- Email:<input type="text" name="email"><br>
- Username:<input type="text" name="user"><br>
- Password:<input type="password" name="pass"><br>
- <input type="submit" name="register" id="register" value="Register Details">
- </form>
- <?php
- if(isset($_POST['register']))
- {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "senseipizza";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . $conn->connect_error);
- }
- $custName = $_POST['name'];
- $custSurname = $_POST['surname'];
- $custPhone = $_POST['phone'];
- $custAddress = $_POST['address'];
- $custEmail = $_POST['email'];
- $custUser = $_POST['user'];
- $custPass = $_POST['pass'];
- $sql = "INSERT INTO customer (customerID, customerName, customerSurname, customerPhone,
- customerAddress, customerEmail, customerUsername, customerPassword)
- VALUES
- ('10''$custName','$custSurname','$custPhone','$custAddress','$custEmail','$custUser','$custPass')";
- if ($conn->query($sql) === TRUE) {
- echo "New record created successfully";
- } else {
- echo "<p>Error: " . $sql . "<br>" . $conn->error . "</p>";
- }
- mysqli_close($conn);
- }
- ?>
- </div>
- </div>
- <footer>
- <p> Sensei Pizza is a pizza registered restaurant and copywrited by the unifications act of the United States © 2016 </p>
- </footer>
- </div>
- </body>
- <?php
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement