Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
- <head>
- <!--general-->
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Exercici 1</title>
- <!--css-->
- <link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" type="text/css" href="css/index.css" />
- <!--Frameworks-->
- <!--<script src="vendors/jquery/js/jquery-3.2.1.min.js" type="text/javascript" xml:space="preserve"></script>-->
- <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript" xml:space="preserve"></script>
- <!--Own code-->
- </head>
- <body>
- <?php
- if (isset($_POST["inputUser"])) {
- $dataBase = [javier => patata, pepito => coliflor];
- if ($dataBase[strtolower($_POST["inputUser"])] == $_POST["inputPassword"]) {
- echo "Holiwi";
- }
- else {
- echo "Jodete";
- unset($_GLOBALS[$_POST["inputUser"]]);
- };
- }
- else {
- echo <<<HER
- <div class="container">
- <form class="form-signin" action="index.php" method="post">
- <h2 class="form-signin-heading">Please sign in</h2>
- <label for="inputUser" class="sr-only">Username</label>
- <input name="inputUser" class="form-control" placeholder="Username" required type="text">
- <label for="inputPassword" class="sr-only">Password</label>
- <input name="inputPassword" class="form-control" placeholder="Password" required type="password">
- <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
- </form>
- </div>
- HER;
- };
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement