40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// Check if the user is logged in
|
|
if (!isset($_SESSION['username']) or !isset($_SESSION["login"])) {
|
|
// Redirect to the login page or handle unauthorized access
|
|
header("Location: /login.php");
|
|
exit();
|
|
}
|
|
|
|
$username = $_SESSION['username'];
|
|
$perms = $_SESSION["perms"];
|
|
$email = $_SESSION["email"];
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
|
<title>Profile</title>
|
|
</head>
|
|
<body>
|
|
<h4>Your Profile</h4>
|
|
<h5><?php echo($username); ?></h5>
|
|
<form action="profile.php" method="post">
|
|
<div class="form-group">
|
|
<label for="username">Username:</label>
|
|
<input type="text" class="form-control" id="username" name="username" value="<?php echo($username); ?>" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email">Email:</label>
|
|
<input type="email" class="form-control" id="email" name="email" value="<?php echo($email); ?>" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary btn-block">Update</button>
|
|
</form>
|
|
</body>
|
|
</html>
|