Marijn button #99
@@ -15,21 +15,21 @@
|
|||||||
|
|
||||||
// Trying to login
|
// Trying to login
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
|
$uname=strtolower($_POST["uname"]);
|
||||||
// Empty username or password field
|
// Empty username or password field
|
||||||
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
|
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
|
||||||
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
|
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$uname=strtolower($_POST["uname"]);
|
|
||||||
$psw=$_POST["psw"];
|
$psw=$_POST["psw"];
|
||||||
$hash=hashPassword()["password"];
|
$hash=hashPassword()["password"];
|
||||||
$userid=hashPassword()["userID"];
|
$userid=hashPassword()["userID"];
|
||||||
|
|
||||||
// If there's an account, go to the profile page
|
// If there's an account, go to the profile page
|
||||||
if(password_verify($psw.$uname, $hash)) {
|
if(password_verify($psw.$uname, $hash)) {
|
||||||
$_SESSION["userID"] = $userid;
|
$_SESSION["userID"] = $userid;
|
||||||
header("location: /profile.php");
|
header("location: profile.php");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$loginErr = "Inloggegevens zijn niet correct";
|
$loginErr = "Inloggegevens zijn niet correct";
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ body {
|
|||||||
height: 900px;
|
height: 900px;
|
||||||
|
|
||||||
background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy);
|
background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy);
|
||||||
background-size: contain;
|
background-size: cover;
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
|
|
||||||
@@ -109,10 +109,10 @@ form {
|
|||||||
border: 5px solid #325da3;
|
border: 5px solid #325da3;
|
||||||
background-color: #a87a87;
|
background-color: #a87a87;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
height: 57%;
|
height: 55%;
|
||||||
margin: 8px auto;
|
margin: 35px auto;
|
||||||
width: 45%;
|
width: 45%;
|
||||||
overflow: auto;
|
overflow-y:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inlog titel */
|
/* inlog titel */
|
||||||
@@ -135,14 +135,14 @@ input[type=text], input[type=password], input[type=email], input[type="date"] {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 50%;
|
height: 50%;
|
||||||
padding: 12px 20px;
|
padding: 8px 20px;
|
||||||
margin: 8px 0;
|
margin: 4px 0;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=submit] {
|
button[type=submit] {
|
||||||
background-color: #845663;
|
background-color: #845663;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|||||||
@@ -18,12 +18,18 @@ function getExistingUsername() {
|
|||||||
|
|
||||||
function getExistingEmail() {
|
function getExistingEmail() {
|
||||||
$stmt = $GLOBALS["db"]->prepare("
|
$stmt = $GLOBALS["db"]->prepare("
|
||||||
SELECT * FROM `user` WHERE `email` = :email
|
SELECT
|
||||||
|
`email`
|
||||||
|
FROM
|
||||||
|
`user`
|
||||||
|
WHERE
|
||||||
|
`email` LIKE :email
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(":email", $_POST["email"]);
|
$stmt->bindParam(":email", $_POST["email"]);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt->rowCount();
|
return $stmt->rowCount();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerAccount() {
|
function registerAccount() {
|
||||||
@@ -54,7 +60,7 @@ function registerAccount() {
|
|||||||
$stmt->bindParam(":username", $_POST["username"]);
|
$stmt->bindParam(":username", $_POST["username"]);
|
||||||
$stmt->bindParam(":password", $hash);
|
$stmt->bindParam(":password", $hash);
|
||||||
$stmt->bindParam(":location", $_POST["location"]);
|
$stmt->bindParam(":location", $_POST["location"]);
|
||||||
$stmt->bindParam(":email", $_POST["email"]);
|
$stmt->bindParam(":email", (strtolower($_POST["email"])));
|
||||||
|
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->rowCount();
|
$stmt->rowCount();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<input type="password"
|
<input type="password"
|
||||||
placeholder="Voer uw wachtwoord in"
|
placeholder="Voer uw wachtwoord in"
|
||||||
name="psw"
|
name="psw"
|
||||||
title="Moet minimaal 1 cijfer, hoofdletter en kleine letter bevatten en minstens 8 karakters lang zijn"
|
title="Moet minstens 8 karakters lang zijn"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -36,10 +36,12 @@
|
|||||||
|
|
||||||
<!-- Button for logging in -->
|
<!-- Button for logging in -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<input type="submit"
|
<button type="submit"
|
||||||
value="Login"
|
value="Login"
|
||||||
name="submit"
|
name="submit"
|
||||||
id="frm1_submit" />
|
id="frm1_submit">
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -120,10 +120,12 @@
|
|||||||
|
|
||||||
<!-- Button for registering -->
|
<!-- Button for registering -->
|
||||||
<div class="login_containerregister">
|
<div class="login_containerregister">
|
||||||
<input type="submit"
|
<button type="submit"
|
||||||
value="Registreer uw account"
|
value="Registreer uw account"
|
||||||
name="Submit"
|
name="Submit"
|
||||||
id="frm1_submit" />
|
id="frm1_submit">
|
||||||
|
Registreer uw account
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user