Skip to content
This repository was archived by the owner on Apr 18, 2021. It is now read-only.

Commit 66fd3f9

Browse files
committed
Verification Error Prompt
Verification & Redirection
1 parent 8131f8b commit 66fd3f9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

account.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
if(session_id() == '' || !isset($_SESSION)){session_start();}
66

77
if(!isset($_SESSION["username"])) {
8-
header("location:index.php");
8+
echo '<h1>Invalid Login! Redirecting...</h1>';
9+
header("Refresh: 3; url=index.php");
910
}
1011

1112
if($_SESSION["type"]==="admin") {

verify.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$username = $_POST["username"];
99
$password = $_POST["pwd"];
10-
10+
$flag = 'true';
1111
//$query = $mysqli->query("SELECT email, password from users");
1212

1313
$result = $mysqli->query('SELECT id,email,password,fname,type from users order by id asc');
@@ -25,13 +25,20 @@
2525
$_SESSION['id'] = $obj->id;
2626
$_SESSION['fname'] = $obj->fname;
2727
header("location:index.php");
28-
}
28+
} else {
2929

30-
else {
31-
header("location:index.php");
30+
if($flag === 'true'){
31+
redirect();
32+
$flag = 'false';
33+
}
3234
}
3335
}
3436
}
3537

38+
function redirect() {
39+
echo '<h1>Invalid Login! Redirecting...</h1>';
40+
header("Refresh: 3; url=index.php");
41+
}
42+
3643

3744
?>

0 commit comments

Comments
 (0)