Advertisement
Guest User

Untitled

a guest
Aug 11th, 2018
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2. require 'db_connection.php';
  3.  ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <!-- saved from url=(0042)https://www.esangroup.com/tatc/ingreso.php -->
  6. <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
  7.  
  8. <title>Registros</title>
  9. <style type="text/css">
  10. .formulario {
  11.     margin-top:5%;
  12.     height: auto;
  13.     width: 600px;
  14.     margin-left:auto;
  15.     margin-right:auto;
  16.     background:rgba(255,255,255,1);
  17.     font-family:Verdana, Geneva, sans-serif;
  18.     border-radius:30px;
  19. }
  20. body {
  21. background: #004792;
  22. margin-top:0px;
  23. }table{
  24.     text-align:left;
  25.    
  26.     padding-top:30px;
  27.     padding-bottom:30px;
  28.     padding-left:50px;
  29.    
  30.    
  31.    
  32.     }.plomo{
  33.         background:rgba(204,204,204,1);
  34.        
  35.         }#banner{
  36.            
  37.             padding-top:0px;
  38.             margin-left:auto;
  39.             margin-right:auto;
  40.            
  41.             }
  42. </style>
  43. </head>
  44.  
  45. <body>
  46.  
  47. <div id="banner" align="center"><img src="image001 copy.jpg"></div>
  48.  
  49. <div class="formulario" align="center">
  50.  
  51. <form name="borm" action="index.php" method="POST">
  52.  
  53.   <p>&nbsp;</p>
  54.   <p>&nbsp;</p>
  55.   <p>Ingreso Empresa</p>
  56.   <p>&nbsp;</p>
  57.   <p> Usuario
  58.       &nbsp; &nbsp;   <input name="usuario" type="text">
  59.     <br><br>
  60.   Contrase«
  61.   <input name="password" type="password">
  62.   </p>
  63.   <p>
  64.     <input type="submit" name="button" id="button" value="Ingresar">
  65.  
  66.   </p>
  67.   <p>&nbsp;</p>
  68.  
  69.  
  70. </form>
  71.  
  72. </div>
  73.  
  74.  
  75. <div id="des_xnba_ewn"></div></body></html>
  76. <?php
  77.    
  78.     if(isset($_POST['button']))
  79.     {
  80.        
  81.         $username = $_POST['usuario'];
  82.         $password = $_POST['password'];
  83.        
  84.        
  85. $sql = "select * from  admin where name = ? AND password = ?";
  86. $stmt= $pdo->prepare($sql);
  87. $stmt->execute();
  88. $row = $stmt->fetch();
  89. if($stmt->rowCount())
  90. {
  91.     session_start();
  92.     $_SESSION['username'] = $row['name'];
  93.     echo "<script>window.location = 'registros.php';</script>";
  94. }
  95.     }
  96.  
  97.  ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement