-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanel-control.php
More file actions
59 lines (47 loc) · 1.58 KB
/
panel-control.php
File metadata and controls
59 lines (47 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
} else {
echo "Inicia Sesion para acceder a este contenido.<br>";
echo "<br><a href='login.html'>Login</a>";
echo "<br><br><a href='index.html'>Registrarme</a>";
header('Location: http://localhost/login/login.html');//redirige a la página de login si el usuario quiere ingresar sin iniciar sesion
exit;
}
$now = time();
if($now > $_SESSION['expire']) {
session_destroy();
header('Location: http://localhost/login/login.html');//redirige a la página de login, modifica la url a tu conveniencia
echo "Tu sesion a expirado,
<a href='login.html'>Inicia Sesion</a>";
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Perfil</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Eliminando el subrayado de los links -->
<!-- Eliminando el subrayado de los links -->
<style type="text/css">
a:link
{
text-decoration:none;
}
</style>
</head>
<body>
<div class="jumbotron text-center">
<h1>Bienvenido <?php echo $_SESSION['username'];?></h1>
<p>Manten tu perfil actualizado</p>
<a href=logout.php><button type="button" class="btn btn-success"> Cerrar Sesion</button></a>
</div>
<div class="container">
</div>
</body>
</html>