Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. <?php require 'connections/connections.php'; ?>
  2. <?php
  3. session_start();
  4. if(isset($_SESSION["UserIdent"])){
  5. }else{
  6. header('Location: login.php');
  7. }
  8. ?>
  9. <?php
  10. $User = $_SESSION["UserIdent"];
  11. $result = $con->query("select * from user where UserID='$User'");
  12. $row = $result->fetch_array(MYSQLI_BOTH);
  13.  
  14. $_SESSION["FirstName"] = $row['Fname'];
  15. $_SESSION["LastName"] = $row['Lname'];
  16. $_SESSION["Username"] = $row['Username'];
  17. $_SESSION["Email"] = $row['Email'];
  18. $_SESSION["Password"] = $row['Password'];
  19. ?>
  20. <?php
  21. if(isset($_POST['UpdateUser'])){
  22. $UpdateFname = $_POST['FirstName'];
  23. $UpdateLname = $_POST['LastName'];
  24. $UpdateUsername = $_POST['Username'];
  25. $UpdateEmail = $_POST['Email'];
  26. $UpdatePassword = $_POST['Password'];
  27. $sql = $con->query("UPDATE user SET Fname = '{$UpdateFname}',
  28. Lname = '{$UpdateLname}',
  29. Email = '{$UpdateEmail}',
  30. Username = '{$UpdateUsername}',
  31. Password = '{$UpdatePassword}',
  32. where UserID= $User");
  33.  
  34.  
  35. header('Location: UpdateAccount.php');
  36. }
  37.  
  38. ?>
  39.  
  40. <!doctype html>
  41. <html>
  42. <head>
  43. <link href="css/Master.css" rel="stylesheet" type="text/css">
  44. <link href="css/Menu.css" rel="stylesheet" type="text/css">
  45. <meta charset="utf-8">
  46. <title>UpdateAccount</title>
  47. </head>
  48. <body>
  49.  
  50. <div id="holder">
  51. <div id="header"></div>
  52. <div id="NavBar">
  53. <nav>
  54. <ul>
  55. <li><a href="account.php">Account</a></li>
  56. <li><a href="Logout.php">Logout</a></li>
  57. </ul>
  58. </nav>
  59. </div>
  60. <div id="Content"></div>
  61. <div id="ContentLeft"></div>
  62.  
  63. <div id="ContentRight"><form> <h6>
  64. <label for="FirstName">First Name:<br>
  65. </label>
  66. <input name="FirstName" type="text" required="required"
  67. class="StyleTxtField" id="FirstName" value="<?php echo
  68. $_SESSION["FirstName"]; ?>">
  69. </h6>
  70. <h6>
  71. <label for="LastName">Last Name:<br>
  72. </label>
  73. <input name="LastName" type="text" required="required" class="StyleTxtField"
  74. id="LastName" value="<?php echo $_SESSION["LastName"]; ?>">
  75. </h6>
  76. <h6>
  77. <label for="Username">Username:<br>
  78. </label>
  79. <input name="Username" type="text" class="StyleTxtField" id="Username"
  80. value="<?php echo $_SESSION["Username"]; ?>">
  81. </h6>
  82. <h6>
  83. <label for="Email">Email:<br>
  84. </label>
  85. <input name="Email" type="text" required="required" class="StyleTxtField"
  86. id="Email" value="<?php echo $_SESSION["Email"]; ?>">
  87. </h6>
  88. <h6>
  89. <label for="Password">Password:<br>
  90. </label>
  91. <input name="Password" type="password" class="StyleTxtField" id="Password"
  92. value="<?php echo $_SESSION["Password"]; ?>">
  93. </h6>
  94.  
  95. <p>
  96. <input name="UpdateUser" type="submit" class="StyleTxtField" id="UpdateUser"
  97. value="UpdateUser">
  98. </p>
  99. </form></div>
  100. <div id="Footer"></div>
  101. </body>
  102. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement