Advertisement
Betabrawler

Untitled

Aug 16th, 2017
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.81 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.   <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <style>
  7. .panel-login{
  8. text-transform: uppercase;
  9. background-color: #f5f5f5;
  10.     font-family: verdana;
  11.  position:relative;
  12.     border-radius: 3px;
  13.     max-width: 400px;
  14.     margin: 200px auto;
  15.     border: 3px dashed #0cb7f5;
  16.  }
  17. form{padding:20px;}
  18. .header{text-align:center; color:#FFF; padding:25px; background-color:#0cb7f5;}
  19. input[type=email], input[type=password]{padding: 11px;
  20.     border-radius: 3px;
  21.     border: 1px solid #DDD;
  22.     width: 100%;
  23.     display: block;
  24.     margin: 15px 0;
  25.     -webkit-box-sizing: border-box;
  26.     -moz-box-sizing: border-box;
  27.     box-sizing: border-box;
  28.     outline: none;
  29.     text-transform: uppercase;
  30.     font-size: 12px;
  31.     font-family: verdana;}
  32. input[type=submit]{
  33.     background-color: #0cb7f5;
  34.     padding: 8px 15px;
  35.     border-radius: 2px;
  36.     /* border-bottom: 3px solid #0cb7f5; */
  37.     color: #FFF;
  38.     font-weight: 600px;
  39.     border: 0;
  40.     border-bottom: 3px solid #049ce4;
  41.     text-transform: uppercase;
  42.     font-weight: 600;
  43.     font-family: arial;
  44.     margin: 5px 0 0 0}
  45.  .user{
  46.  background-color: #f5f5f5;
  47.     border-radius: 50%;
  48.     width: 100Px;
  49.     height: 100px;
  50.     position: absolute;
  51.     top: -60px;
  52.     left: 0;
  53.     right: 0;
  54.     margin: auto;
  55.     border: 1px solid #9e9e9e;}
  56.  span.text{
  57.  margin-top: 25px;
  58.     display: block;}
  59. </style>
  60. </head>
  61. <body>
  62.  
  63. <div class="panel-login">
  64. <div class="header"><div class="user"><img src="IMG/icon.png" width=90 alt=""></div><span class="text">Iniciar sesión</span></div>
  65. <form method="POST" action="#">
  66. <input type="email" name="email" class="email" placeholder="email" />
  67. <input type="password" name="clave" class="clave" placeholder="clave" />
  68. <input type="submit" value="Login" name="submit" />
  69. <center><u><a href="crear.php">Si no tiene una cuenta, ingrese aqui</a><u/><center/>
  70. </form>
  71. <?php
  72. if(isset($_POST["submit"])){
  73.  
  74. if(!empty($_POST['email']) && !empty($_POST['clave'])) {
  75.     $email=$_POST['email'];
  76.     $clave=$_POST['clave'];
  77.  
  78.     $con=mysql_connect('localhost','root','') or die(mysql_error());
  79.     mysql_select_db('usuario') or die("cannot select DB");
  80.  
  81.     $query=mysql_query("SELECT * FROM login WHERE email='".$email."' AND clave='".$clave."'");
  82.     $numrows=mysql_num_rows($query);
  83.     if($numrows!=0)
  84.     {
  85.     while($row=mysql_fetch_assoc($query))
  86.     {
  87.     $dbusername=$row['email'];
  88.     $dbpassword=$row['clave'];
  89.     }
  90.  
  91.     if($email == $dbusername && $clave == $dbpassword)
  92.     {
  93.     session_start();
  94.     $_SESSION['sess_user']=$email;
  95.  
  96.     /* Redirect browser */
  97.     header("Location: Inicio.php");
  98.     }
  99.     } else {
  100.     echo "Nombre de usuario invalido o clave incorrecta";
  101.     }
  102.  
  103. } else {
  104.     echo "Todos los campos son requeridos";
  105. }
  106.  
  107.  
  108. }
  109.  
  110. ?>
  111. </div>
  112.  
  113.  
  114.  
  115. </body>
  116. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement