-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.php
More file actions
40 lines (38 loc) · 1.45 KB
/
auth.php
File metadata and controls
40 lines (38 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<?php
session_start();
?>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="3; url=<?php
echo $_SESSION["lastpage"];
?>"/>
<title></title>
<script>
var x = 3;
var counter = setInterval(changeText, 1000);
function changeText(){
x--;
if(x <= 0){
clearInterval(counter);
return;
}
document.getElementById('seconds').innerHTML = x;
}
</script>
</head>
<body onload="">
Authentication <span id="check" style="font-weight: bold;"></span>, redirecting back in <span id="seconds">3</span> seconds.
<?php
if($_POST["login"] == "admin" && $_POST["password"] == "talentpassword"){
echo "<script>document.getElementById('check').innerHTML = 'succesful'</script>";
echo "<script>document.getElementById('check').style.color = 'green'</script>";
$_SESSION["usertype"] = "administrator";
} else {
echo "<script>document.getElementById('check').innerHTML = 'unsuccesful'</script>";
echo "<script>document.getElementById('check').style.color = 'red'</script>";
}
?>
</body>
</html>