Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require 'connections/connections.php'; ?>
- <?php
- session_start();
- if(isset($_SESSION["UserIdent"])){
- }else{
- header('Location: login.php');
- }
- ?>
- <?php
- $User = $_SESSION["UserIdent"];
- $result = $con->query("select * from user where UserID='$User'");
- $row = $result->fetch_array(MYSQLI_BOTH);
- $_SESSION["FirstName"] = $row['Fname'];
- $_SESSION["LastName"] = $row['Lname'];
- $_SESSION["Username"] = $row['Username'];
- $_SESSION["Email"] = $row['Email'];
- $_SESSION["Password"] = $row['Password'];
- ?>
- <?php
- if(isset($_POST['UpdateUser'])){
- $UpdateFname = $_POST['FirstName'];
- $UpdateLname = $_POST['LastName'];
- $UpdateUsername = $_POST['Username'];
- $UpdateEmail = $_POST['Email'];
- $UpdatePassword = $_POST['Password'];
- $sql = $con->query("UPDATE user SET Fname = '{$UpdateFname}',
- Lname = '{$UpdateLname}',
- Email = '{$UpdateEmail}',
- Username = '{$UpdateUsername}',
- Password = '{$UpdatePassword}',
- where UserID= $User");
- header('Location: UpdateAccount.php');
- }
- ?>
- <!doctype html>
- <html>
- <head>
- <link href="css/Master.css" rel="stylesheet" type="text/css">
- <link href="css/Menu.css" rel="stylesheet" type="text/css">
- <meta charset="utf-8">
- <title>UpdateAccount</title>
- </head>
- <body>
- <div id="holder">
- <div id="header"></div>
- <div id="NavBar">
- <nav>
- <ul>
- <li><a href="account.php">Account</a></li>
- <li><a href="Logout.php">Logout</a></li>
- </ul>
- </nav>
- </div>
- <div id="Content"></div>
- <div id="ContentLeft"></div>
- <div id="ContentRight"><form> <h6>
- <label for="FirstName">First Name:<br>
- </label>
- <input name="FirstName" type="text" required="required"
- class="StyleTxtField" id="FirstName" value="<?php echo
- $_SESSION["FirstName"]; ?>">
- </h6>
- <h6>
- <label for="LastName">Last Name:<br>
- </label>
- <input name="LastName" type="text" required="required" class="StyleTxtField"
- id="LastName" value="<?php echo $_SESSION["LastName"]; ?>">
- </h6>
- <h6>
- <label for="Username">Username:<br>
- </label>
- <input name="Username" type="text" class="StyleTxtField" id="Username"
- value="<?php echo $_SESSION["Username"]; ?>">
- </h6>
- <h6>
- <label for="Email">Email:<br>
- </label>
- <input name="Email" type="text" required="required" class="StyleTxtField"
- id="Email" value="<?php echo $_SESSION["Email"]; ?>">
- </h6>
- <h6>
- <label for="Password">Password:<br>
- </label>
- <input name="Password" type="password" class="StyleTxtField" id="Password"
- value="<?php echo $_SESSION["Password"]; ?>">
- </h6>
- <p>
- <input name="UpdateUser" type="submit" class="StyleTxtField" id="UpdateUser"
- value="UpdateUser">
- </p>
- </form></div>
- <div id="Footer"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement