-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
31 lines (31 loc) · 956 Bytes
/
index.php
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
<?php
session_start();
if(isset($_SESSION["username"]) && isset($_SESSION["email"])){
header("Location: acc.php");
}
?>
<title>JSON login system</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<form action="log.php" method="post" enctype="multipart/form-data">
<h1>JSON login system</h1>
<p>Username:</p>
<input type="text" maxlength="16" required name="username" >
<p>Password:</p>
<input type="password" required name="password" > <input type="submit" name="submit" value="Log in" >
</form>
<a href="register.php">I don't have an account!</a>
<br />
<?php
if(isset($_GET["err"])){
if($_GET["err"] === "1"){
// This will most likely never happen unless the user goes to log.php in their browser.
echo "Error: You did not fill in all forms";
}
if($_GET["err"] === "2"){
echo "Error: Invalid password";
}
if($_GET["err"] === "3"){
echo "Error: That account does not exist";
}
}
?>