diff options
| author | oweissbarth | 2014-03-16 17:01:10 +0100 |
|---|---|---|
| committer | oweissbarth | 2014-03-16 17:01:10 +0100 |
| commit | 5b9cbe1d06a47aee4d32099a861f97e8a8b59633 (patch) | |
| tree | 956625c701b016a95abeba9fcfbc03f024e846bc /www/login.php | |
| parent | 09d24a3f321476ecdbbf10156fe724343a7d4084 (diff) | |
| download | files.iamfabulous.de-5b9cbe1d06a47aee4d32099a861f97e8a8b59633.tar.gz | |
MVD Loginmvc
Diffstat (limited to 'www/login.php')
| -rwxr-xr-x | www/login.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/www/login.php b/www/login.php index 3207703..0e281e5 100755 --- a/www/login.php +++ b/www/login.php @@ -18,10 +18,11 @@ */ ?> -<?php include("static/header.html");?> +<?php include("static/header.html"); +require_once("include.php");?> <link rel="stylesheet" type="text/css" href="/static/login.css"> - + <?php if(!isset($_POST['login'])){?> <div class="login-area"> <h1 class="login-area"> Log in </h1> <div class="login-area" id="login-info-bar"> @@ -36,7 +37,7 @@ '; }?> </div> - <form id="login-form" method='post' action='/login'> + <form id="login-form" method='post' action='login.php'> <?php if(isset($_GET['reason']) && $_GET['reason'] == 'failure' && isset($_GET['username'])){ echo '<input type="text" placeholder="username" name="username" id="username-input" class="login-input" value="'.$_GET['username'].'"required> '; @@ -50,5 +51,18 @@ <a href="recover-password.php" id="recover-password-link">recover password</a> </form> </div> + + <?php + }else{ + $username = $_POST['username']; + $password = $_POST['password']; + if(($result=login($username, $password)=="success")){ + header("Refresh: 0; /"); + }else{ + echo $result; + exit; + header("Refresh: 0; /login.php?reason=".$result."&username=".$username); + } + }?> <?php include("static/footer.html");?> |
