Merge branch 'master' into kevin-prototype

This commit is contained in:
K. Nobel
2017-01-20 12:18:47 +01:00
3 changed files with 37 additions and 7 deletions

View File

@@ -4,11 +4,18 @@
include("../views/login_head.php");
require_once("../queries/connect.php");
include_once("../queries/login.php");
include_once("../queries/checkInput.php")
?>
<body>
<?php
session_start();
if(isset($_SESSION["userID"])){
echo "<script>
window.onload=checkLoggedIn();
</script>";
}
// Define variables and set to empty values
$uname = $psw ="";
$loginErr ="";
@@ -41,5 +48,18 @@
/* This view adds login view */
include("../views/login-view.php");
?>
<script>
function checkLoggedIn() {
if (confirm("You are already logged in!\Do you want to logout?\Press ok to logout.") == true) {
unset($_SESSION["userID"]);
header("Location: login.php");
} else {
header("location: profile.php");
}
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

View File

@@ -29,7 +29,7 @@
}
checkInputChoice("username", "username");
checkInputChoice("password", "longerEigth");
checkInputChoice("password", "longerEight");
checkInputChoice("confirmpassword", "");
matchPassword();
checkInputChoice("location", "lettersAndSpace");