I don't have an account!
";
$json = file_get_contents("data/" . $_POST["ts_user"] . ".json");
$jsonD = json_decode($json, true);
if(password_verify($_POST["password"], $jsonD["password"])){
// Initiate page.
session_start();
$_SESSION["ts_user"] = $jsonD["username"];
$_SESSION["ts_points"] = $jsonD["points"];
$_SESSION["email"] = $jsonD["email"];
header("Location: acc.php");
echo "";
} else {
header("Location: index.php?err=2");
echo "";
}
} else {
header("Location: index.php?err=3");
echo "";
}
} else {
}
}
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";
}
}
?>