Merge branch 'joey-testing' into 'master'
added checked already logged in function See merge request !74
This commit was merged in pull request #78.
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if(isset($_SESSION["userID"])){
|
||||
window.onload=checkLoggedIn();
|
||||
}
|
||||
|
||||
// Define variables and set to empty values
|
||||
$uname = $psw ="";
|
||||
$loginErr ="";
|
||||
@@ -42,5 +46,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>
|
||||
|
||||
Reference in New Issue
Block a user