Advertisement
Uriell717171

login

Oct 31st, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.67 KB | None | 0 0
  1. <script language= javascript type= text/javascript >
  2.  
  3. function loadDoc(div,page) {
  4.  
  5.     var xhttp = new XMLHttpRequest();
  6.     xhttp.onreadystatechange = function() {
  7.         if (this.readyState == 4 && this.status == 200) {
  8.             document.getElementById(div).innerHTML =
  9.             this.responseText;
  10.         }
  11.     };
  12. xhttp.open("GET", page, true);
  13. xhttp.send();
  14. }
  15. </script>
  16.  
  17. <?PHP
  18.  
  19. //include("funjs/funcion.js");
  20. $local_user = "Test";
  21. $local_password = "123";
  22. if (isset($_POST['login'])) // check if user enter submit
  23. {
  24.     $u_post = $_POST['username']; // get user input
  25.     $p_post = $_POST['password']; // get password input
  26.  
  27.     if ($local_user == $u_post)
  28.     {
  29.         if ($local_password == $p_post)
  30.         {
  31.             echo "<script>";
  32.             echo 'loadDoc("resultado","test.html");';
  33.             echo "</script>";  
  34.             //die(); //you can arrive the user to welcome page from here
  35.         }
  36.         else
  37.         echo "password no es !"; // if username is correct but password is not
  38.         die();
  39.     }
  40.     else
  41.     {
  42.         echo "usuario que mierc!";  // if username is not correct then no need to check password ! .
  43.         die();
  44.     }
  45. }
  46.  
  47.  
  48.  
  49. ?>
  50.  
  51. <html>
  52. <head>
  53.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  54.     <link rel="stylesheet" type="text/css" href="CSS/pru.css" media="screen"/>        
  55.     <link rel="stylesheet" type="text/css" href="CSS/prumedia.css" media="screen"/>        
  56.     <link rel="stylesheet" type="text/css" href="CSS/celprumedia.css" media="screen"/>        
  57.     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" charset="utf-8">
  58.     <script language="javascript" type="text/javascript" src="funjs/funcion.js"></script>
  59.  
  60.     <title>local login page !</title>
  61. </head>
  62. <body>
  63.  
  64.      <div class="barra">
  65.         <div class="slide">
  66.             <div class="linea">III
  67.                 <input type="button" name="" class="slid"></input>
  68.             </div>
  69.         </div>
  70.  
  71.         <div class="titulo"><br>Sistema de Gestion Agropecuaria <b>Cabestro</b><br><br><br></div>
  72.         <div class="botonera">
  73.             <div class="butonbar" type="button">Tienda</div>
  74.             <div class="butonbar" type="button">Rubros</div>
  75.             <div class="butonbar" type="button">Ganado</div>
  76.             <div class="butonbar" type="button">Queso</div>
  77.             <div class="butonbar" type="button">Compras</div>
  78.             <div class="butonbar" type="button">Registro</div>
  79.             <div class="butonbar" type="button">Evaluacion</div>
  80.             <div class="butonbar" type="button">Estatus</div>
  81.             <div class="butonbar" type="button">Crypto</div>
  82.             <div class="butonbar" type="button">Quienes Somos</div>
  83.  
  84.         </div>
  85.      </div>
  86.  
  87.     <div class="logins">
  88.  
  89.     <!--formulario de login-->
  90.     <form action="" method="POST" class="logbox">
  91.         <b>Usuario:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  92.         <input type="text"  name="username" placeholder="Enter username"/>
  93.         <br>
  94.         <b>Contraseña:</b>  
  95.         <input type="password" name="password" placeholder="Enter password" />
  96.         <br><br><br>
  97.         <input type="input" name="login" value="Ingresar" class="button" />
  98.     </form>
  99.     </div>
  100.    
  101.     <!-- capa de centro-->
  102.     <div class="centro" id="resultado"><p>hola amigos de youtube</p></div>
  103.  
  104.      <!--pie de pagina-->
  105.     <div class="pie">Copyright 2018 GPSystem,C.A., Ing. Luis Hermoso, Rif V-165120961. Todos los derechos reservados</div>
  106.  
  107. </body>
  108. </html>
  109. <?
  110. /*
  111.  *
  112.  *
  113.  * [Igbaryya] [so/q/36129122] [cc by-sa 3.0]
  114.  */
  115. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement