Marijn button #99

Merged
11166932 merged 152 commits from marijn-button into master 2017-01-23 13:25:08 +01:00
5 changed files with 27 additions and 17 deletions
Showing only changes of commit b95705df29 - Show all commits

View File

@@ -15,21 +15,21 @@
// Trying to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$uname=strtolower($_POST["uname"]);
// Empty username or password field
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
}
else {
$uname=strtolower($_POST["uname"]);
$psw=$_POST["psw"];
$hash=hashPassword()["password"];
$userid=hashPassword()["userID"];
// If there's an account, go to the profile page
if(password_verify($psw.$uname, $hash)) {
$_SESSION["userID"] = $userid;
header("location: /profile.php");
header("location: profile.php");
} else {
$loginErr = "Inloggegevens zijn niet correct";

View File

@@ -60,7 +60,7 @@ body {
height: 900px;
background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy);
background-size: contain;
background-size: cover;
background-repeat: repeat-x;
background-attachment: fixed;
@@ -109,10 +109,10 @@ form {
border: 5px solid #325da3;
background-color: #a87a87;
border-radius: 12px;
height: 57%;
margin: 8px auto;
height: 55%;
margin: 35px auto;
width: 45%;
overflow: auto;
overflow-y:auto;
}
/* inlog titel */
@@ -135,14 +135,14 @@ input[type=text], input[type=password], input[type=email], input[type="date"] {
box-sizing: border-box;
display: inline-block;
height: 50%;
padding: 12px 20px;
margin: 8px 0;
padding: 8px 20px;
margin: 4px 0;
width: 50%;
font-family: Arial;
font-size: 16px;
}
input[type=submit] {
button[type=submit] {
background-color: #845663;
border: 2px solid black;
border-radius: 12px;

View File

@@ -18,12 +18,18 @@ function getExistingUsername() {
function getExistingEmail() {
$stmt = $GLOBALS["db"]->prepare("
SELECT * FROM `user` WHERE `email` = :email
SELECT
`email`
FROM
`user`
WHERE
`email` LIKE :email
");
$stmt->bindParam(":email", $_POST["email"]);
$stmt->execute();
return $stmt->rowCount();
}
function registerAccount() {
@@ -54,7 +60,7 @@ function registerAccount() {
$stmt->bindParam(":username", $_POST["username"]);
$stmt->bindParam(":password", $hash);
$stmt->bindParam(":location", $_POST["location"]);
$stmt->bindParam(":email", $_POST["email"]);
$stmt->bindParam(":email", (strtolower($_POST["email"])));
$stmt->execute();
$stmt->rowCount();

View File

@@ -27,7 +27,7 @@
<input type="password"
placeholder="Voer uw wachtwoord in"
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>
@@ -36,10 +36,12 @@
<!-- Button for logging in -->
<div class="login_containerlogin">
<input type="submit"
<button type="submit"
value="Login"
name="submit"
id="frm1_submit" />
id="frm1_submit">
Login
</button>
</div>
</form>

View File

@@ -120,10 +120,12 @@
<!-- Button for registering -->
<div class="login_containerregister">
<input type="submit"
<button type="submit"
value="Registreer uw account"
name="Submit"
id="frm1_submit" />
id="frm1_submit">
Registreer uw account
</button>
</div>
</form>