You are on page 1of 3

<html>

2 <head>
3 <title>Login</title>
4 <link rel="stylesheet" type="text/css" href="estilos.css">
5 </head>
6 <body>
7 <div id="login">
8 <form action= "usuario.php" method="GET">
9 <label>Usuario: </label>
10 <input type="text" name="user"/><br>
11 <label>Contraseña: </label>
12 <input type="password" name="password"/><br><br>
13 <input type="submit" value="Enviar"/>
14 </form>
15 </div>
16 </body>
17 </html>

<?php
2 $user = $_GET['user'];
3 $password = $_GET['password'];
4
5 if (($user == "usuario") AND ($password == "12345")) {
6 echo "Bienvenido ".$user;
7 } else {
8 echo "¡Usuario o contraseña incorrectos!";
9 echo '<br><a href="'.$_SERVER['HTTP_REFERER'].'">Volver</a>';
10 }
11 ?>

estilos

#login {
4 background-color: #77B0C5;
5 border-radius: 8px;
6 box-shadow: 3px 3px 10px 0px rgba(50, 50, 50, 0.75);
7 -moz-box-shadow: 3px 3px 10px 0px rgba(50, 50, 50, 0.75);
8 -webkit-box-shadow: 3px 3px 10px 0px rgba(50, 50, 50, 0.75);
9 margin-left: auto;
10 margin-right: auto;
11 margin-top: 10%;
12 max-width: 20em;
13 padding-bottom: 10px;
14 padding-top: 10px;
15 }
16
17 /* Etiquetas del formulario */
18
19 label {
20 color: white;
21 display: block;
22 margin-bottom: 6px;
23 margin-left: 1.2em;
24 }
25
26 /* Campos del formulario */
27
28 input[type="text"],
29 input[type="password"] {
30 border: none;
31 border-radius: 6px;
32 display: block;
33 font-size: 1em;
34 height: 2em;
35 text-align: center;
36 width: 90%;
37 margin-left: auto;
38 margin-right: auto;
39 }
40
41 /* Botón */
42
43 input[type="submit"] {
44 background-color: #A3A0A2;
45 border: none;
46 border-radius: 6px;
47 color: white;
48 display: block;
49 font-size: 1em;
50 height: 3em;
51 margin-left: auto;
52 margin-right: auto;
53 margin-top: -10px;
54 text-align: center;
55 width: 150px;
56 }
57
58 input[type="submit"]:hover {
59 cursor: pointer;
60 background-color: #A33D41;
61 opacity: 0.8;
62 }

You might also like