-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
78 lines (76 loc) · 2.31 KB
/
index.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
session_start();
if (isset($_SESSION["user"])){
header("location:./welcome2.php");
}
?>
<html lang="es">
<head>
<title>Bienvenido</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css"/>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style>
body{
font-family: "Open Sans", sans-serif;
text-align: center;
}
</style>
</head>
<body>
<div class="login-container">
<h1>Bienvenido a Tutomax</h1>
<div class="container">
<div class="row">
<div class="span12">
<form class="form-horizontal" action="./welcome2.php" method="post">
<fieldset>
<div id="legend">
<legend class="">Login</legend>
</div>
<div class="control-group">
<!-- Username -->
<label class="control-label" for="username">Usuario</label>
<div class="controls">
<input type="text" id="username" name="username" placeholder="" class="input-xlarge">
</div>
</div>
<div class="control-group">
<!-- Password-->
<label class="control-label" for="password">Contraseña</label>
<div class="controls">
<input type="password" id="password" name="pass" placeholder="" class="input-xlarge">
</div>
</div>
<div class="control-group">
<!-- Button -->
<div class="controls">
<button class="btn btn-default">Iniciar Sesión</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
<a href="registro.php">Regístrate</a>
</div>
<?php
$error = '<span>Fallo en el inicio de sesión.</span>';
/*if (isset($_POST["username"]) && isset($_POST["pass"])){
if ($_POST["username"] === "user" && $_POST["pass"] === "pass"){
$_SESSION["user"] = $_POST["username"];
$_SESSION["pass"] = $_POST["pass"];
}
else{
echo $error;
}
}*/
if (isset($_SESSION["error"]) && $_SESSION["error"]==="error"){
echo $error;
session_destroy();
}
?>
</div>
</body>
</html>