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
- session_start();
- ?>
- <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="custhome.php">Home</a></li>
- <li><a href="profile.php">Profile</a></li>
- <li><a href="logout.php">Logout</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>
- <input type="submit" name="update" id="update" value="Update Details">
- </form>
- <?php
- if(isset($_POST['update']))
- {
- $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);
- }
- $name = $_POST['name'];
- $surname = $_POST['surname'];
- $phone = $_POST['phone'];
- $address = $_POST['address'];
- $email = $_POST['email'];
- $ID = $_SESSION["customerID"];
- $sql = "UPDATE customer SET customerName=$name, customerSurname=$surname
- , customerPhone=$phone, customerAddress=$address
- , customerEmail=$email WHERE customerID=$ID";
- if ($conn->query($sql) === TRUE) {
- echo "Your details have been updated";
- } else {
- echo "There has been an error recording your details: " . $conn->error;
- }
- 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