Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- var_dump( $_POST);
- function Login($user,$pass){
- if($user != "biggun"|| $pass != "boom"){
- return false;
- }else{
- return true;
- }
- }
- if(!empty($_POST)){
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- if(Login($user, $pass)===true){
- $salt = "kill";
- $cookieVal = $user . "," . md5($user.$salt);
- setcookie("loggedin", $cookieVal,time()+60*60*24*30); //1maand
- header('Location: index.php');
- } else{
- $error = true;
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- <link rel="stylesheet" href="css.css">
- </head>
- <body>
- <div id="app">
- <form action="" method="post">
- <h1>Log in to Twitch</h1>
- <nav class="nav--login">
- <a href="#" id="tabLogin">Log in</a>
- <a href="#" id="tabSignIn">Sign up</a>
- </nav>
- <?php if( isset($error) ): ?>
- <div class="alert hidden">That password was incorrect. Please try again</div>
- <?php endif; ?>
- <div class="form form--login">
- <label for="username">Username</label>
- <input type="text" id="username" name="user">
- <label for="password">Password</label>
- <input type="password" id="password" name="pass">
- </div>
- <div class="form form--signup hidden">
- <label for="username2">Username</label>
- <input type="text" id="username2">
- <label for="password2">Password</label>
- <input type="password" id="password2">
- <label for="email">Email</label>
- <input type="text" id="email">
- </div>
- <a href="#" class="btn" id="btnSubmit">Log In</a>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement