Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.84 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.  
  3.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  6.  
  7.     <head>
  8.  
  9.         <!--general-->
  10.  
  11.         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  12.  
  13.         <title>Exercici 1</title>
  14.  
  15.            
  16.  
  17.         <!--css-->
  18.  
  19.         <link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css" />
  20.  
  21.         <link rel="stylesheet" type="text/css" href="css/index.css" />
  22.  
  23.            
  24.  
  25.         <!--Frameworks-->
  26.  
  27.         <!--<script src="vendors/jquery/js/jquery-3.2.1.min.js" type="text/javascript" xml:space="preserve"></script>-->
  28.  
  29.         <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript" xml:space="preserve"></script>
  30.  
  31.            
  32.  
  33.         <!--Own code-->
  34.  
  35.     </head>
  36.  
  37.     <body>
  38.             <?php
  39.  
  40.                 if (isset($_POST["inputUser"])) {
  41.                     $dataBase = [javier => patata, pepito => coliflor];
  42.  
  43.                     if ($dataBase[strtolower($_POST["inputUser"])] == $_POST["inputPassword"]) {
  44.                         echo "Holiwi";
  45.                     }
  46.    
  47.                     else {
  48.                         echo "Jodete";
  49.                        
  50.                         unset($_GLOBALS[$_POST["inputUser"]]);
  51.                     };
  52.                 }
  53.                
  54.                 else {
  55.                     echo <<<HER
  56.                         <div class="container">                
  57.                           <form class="form-signin" action="index.php" method="post">
  58.                             <h2 class="form-signin-heading">Please sign in</h2>
  59.                             <label for="inputUser" class="sr-only">Username</label>
  60.                             <input name="inputUser" class="form-control" placeholder="Username" required type="text">
  61.                             <label for="inputPassword" class="sr-only">Password</label>
  62.                             <input name="inputPassword" class="form-control" placeholder="Password" required type="password">
  63.                             <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
  64.                           </form>                  
  65.                         </div>
  66. HER;
  67.                 };
  68.  
  69.             ?>
  70.     </body>
  71.  
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement