Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <style>
- .panel-login{
- text-transform: uppercase;
- background-color: #f5f5f5;
- font-family: verdana;
- position:relative;
- border-radius: 3px;
- max-width: 400px;
- margin: 200px auto;
- border: 3px dashed #0cb7f5;
- }
- form{padding:20px;}
- .header{text-align:center; color:#FFF; padding:25px; background-color:#0cb7f5;}
- input[type=email], input[type=password]{padding: 11px;
- border-radius: 3px;
- border: 1px solid #DDD;
- width: 100%;
- display: block;
- margin: 15px 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- outline: none;
- text-transform: uppercase;
- font-size: 12px;
- font-family: verdana;}
- input[type=submit]{
- background-color: #0cb7f5;
- padding: 8px 15px;
- border-radius: 2px;
- /* border-bottom: 3px solid #0cb7f5; */
- color: #FFF;
- font-weight: 600px;
- border: 0;
- border-bottom: 3px solid #049ce4;
- text-transform: uppercase;
- font-weight: 600;
- font-family: arial;
- margin: 5px 0 0 0}
- .user{
- background-color: #f5f5f5;
- border-radius: 50%;
- width: 100Px;
- height: 100px;
- position: absolute;
- top: -60px;
- left: 0;
- right: 0;
- margin: auto;
- border: 1px solid #9e9e9e;}
- span.text{
- margin-top: 25px;
- display: block;}
- </style>
- </head>
- <body>
- <div class="panel-login">
- <div class="header"><div class="user"><img src="IMG/icon.png" width=90 alt=""></div><span class="text">Iniciar sesión</span></div>
- <form method="POST" action="#">
- <input type="email" name="email" class="email" placeholder="email" />
- <input type="password" name="clave" class="clave" placeholder="clave" />
- <input type="submit" value="Login" name="submit" />
- <center><u><a href="crear.php">Si no tiene una cuenta, ingrese aqui</a><u/><center/>
- </form>
- <?php
- if(isset($_POST["submit"])){
- if(!empty($_POST['email']) && !empty($_POST['clave'])) {
- $email=$_POST['email'];
- $clave=$_POST['clave'];
- $con=mysql_connect('localhost','root','') or die(mysql_error());
- mysql_select_db('usuario') or die("cannot select DB");
- $query=mysql_query("SELECT * FROM login WHERE email='".$email."' AND clave='".$clave."'");
- $numrows=mysql_num_rows($query);
- if($numrows!=0)
- {
- while($row=mysql_fetch_assoc($query))
- {
- $dbusername=$row['email'];
- $dbpassword=$row['clave'];
- }
- if($email == $dbusername && $clave == $dbpassword)
- {
- session_start();
- $_SESSION['sess_user']=$email;
- /* Redirect browser */
- header("Location: Inicio.php");
- }
- } else {
- echo "Nombre de usuario invalido o clave incorrecta";
- }
- } else {
- echo "Todos los campos son requeridos";
- }
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement