48 lines
1011 B
PHP
48 lines
1011 B
PHP
<?php include("head.php"); ?>
|
|
|
|
|
|
<?php
|
|
|
|
/* handle form */
|
|
|
|
if(isset($_POST["name"], $_POST["password"])){
|
|
$name = $_POST["name"];
|
|
$password = $_POST["password"];
|
|
|
|
if(dbUserExist($name)) {
|
|
if(verifyLogin($name, $password)) {
|
|
login($name);
|
|
redirect("/user.php");
|
|
}
|
|
else{
|
|
include("errors/users/userPasswordIncorrect.php");
|
|
}
|
|
}
|
|
else{
|
|
include("errors/users/userNotExists.php");
|
|
}
|
|
}
|
|
|
|
?>
|
|
<span class="heading">
|
|
<p>Login</p>
|
|
</span>
|
|
|
|
<span class="info">
|
|
<p>Enter your username and password:</p>
|
|
</span>
|
|
|
|
<div class="info">
|
|
<form action="login.php" method="post">
|
|
<p><input class="textinput" type="text" name="name" placeholder="Username"/></p>
|
|
<p><input class="textinput" type="password" name="password" placeholder="Password"/></p>
|
|
<p><input class="button" type="submit" value="Login"/></p>
|
|
</form>
|
|
</div>
|
|
|
|
<span class="info">
|
|
<p>Don't have an account? <a href="/register.php">Create an Account</a></p>
|
|
</span>
|
|
|
|
|
|
<?php include("foot.php"); ?>
|