Splitted login and register pages
This commit is contained in:
@@ -5,9 +5,65 @@ include("../views/login_head.php");
|
|||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
/*
|
session_start();
|
||||||
* This view adds login view
|
|
||||||
*/
|
// Define variables and set to empty values
|
||||||
|
$uname = $psw ="";
|
||||||
|
$loginErr ="";
|
||||||
|
|
||||||
|
|
||||||
|
// Trying to login
|
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
|
// Empty username or password field
|
||||||
|
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
|
||||||
|
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$uname=$_POST["uname"];
|
||||||
|
$psw=$_POST["psw"];
|
||||||
|
|
||||||
|
// Protection against MySQL injections
|
||||||
|
$uname = stripslashes($uname);
|
||||||
|
$psw = stripslashes($psw);
|
||||||
|
$uname = mysql_real_escape_string($uname);
|
||||||
|
$psw = mysql_real_escape_string($psw);
|
||||||
|
|
||||||
|
// Database information
|
||||||
|
$servername = "agile136.science.uva.nl";
|
||||||
|
$username = "mhbp";
|
||||||
|
$password = "qdtboXhCHJyL2szC";
|
||||||
|
|
||||||
|
// Creates connection
|
||||||
|
$conn = new mysqli($servername, $username, $password);
|
||||||
|
|
||||||
|
// Selects database
|
||||||
|
$db = mysql_select_db("company", $connection);
|
||||||
|
|
||||||
|
// Query for listing all accounts that meets the requirement of the login information
|
||||||
|
$query = mysql_query("select * from login where password='$psw' AND username='$uname'", $connection);
|
||||||
|
|
||||||
|
// Checks if there's an account
|
||||||
|
$count = mysql_num_rows($query);
|
||||||
|
|
||||||
|
// If there's an account, go to the profile page
|
||||||
|
if($count == 1) {
|
||||||
|
$_SESSION[$uname] = $uname;
|
||||||
|
$_SESSION[$userID] = $userID;
|
||||||
|
|
||||||
|
header("location: myhyvesbookplus.nl/profile.php");
|
||||||
|
}else {
|
||||||
|
$loginErr = "Inloggegevens zijn niet correct";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Closing Connection
|
||||||
|
mysql_close($connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* This view adds login view */
|
||||||
include("../views/login-view.php");
|
include("../views/login-view.php");
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
200
website/public/register.php
Normal file
200
website/public/register.php
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<?php
|
||||||
|
include("../views/login_head.php");
|
||||||
|
include_once("../queries/connect.php");
|
||||||
|
|
||||||
|
?>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// define variables and set to empty values
|
||||||
|
$name = $surname = $bday = $username = $password = $confirmpassword = $streetname = $housenumber = $email = "";
|
||||||
|
$genericErr = $nameErr = $surnameErr = $bdayErr = $usernameErr = $passwordErr = $confirmpasswordErr = $streetnameErr = $housenumberErr = $emailErr = "";
|
||||||
|
$correct = true;
|
||||||
|
|
||||||
|
// Saves information of filling in the form
|
||||||
|
if (isset($_POST["name"])) {
|
||||||
|
$name = $_POST["name"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["surname"])) {
|
||||||
|
$surname = $_POST["surname"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["bday"])) {
|
||||||
|
$bday = $_POST["bday"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["username"])) {
|
||||||
|
$username = $_POST["username"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["password"])) {
|
||||||
|
$password = $_POST["password"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["streetname"])) {
|
||||||
|
$streetname = $_POST["streetname"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["housenumber"])) {
|
||||||
|
$housenumber = $_POST["housenumber"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["email"])) {
|
||||||
|
$email = $_POST["email"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trying to register an account
|
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
|
if (empty($_POST["name"])) {
|
||||||
|
$nameErr = "Naam is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
|
||||||
|
$nameErr = "Alleen letters en spaties zijn toegestaan!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["surname"])) {
|
||||||
|
$surnameErr = "Achternaam is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!preg_match("/^[a-zA-Z ]*$/",$surname)) {
|
||||||
|
$surnameErr = "Alleen letters en spaties zijn toegestaan!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($_POST["bday"])) {
|
||||||
|
$bdayErr = "Geboortedatum is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["username"])) {
|
||||||
|
$usernameErr = "Gebruikersnaam is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (strlen($username) < 6) {
|
||||||
|
$usernameErr = "Gebruikersnaam moet minstens 6 karakters bevatten";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["password"])) {
|
||||||
|
$passwordErr = "Wachtwoord is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (strlen($password) < 8) {
|
||||||
|
$passwordErr = "Wachtwoord moet minstens 8 karakters bevatten";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["confirmpassword"])) {
|
||||||
|
$confirmpasswordErr = "Herhaal wachtwoord!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST["password"]!= $_POST["confirmpassword"]) {
|
||||||
|
$confirmpasswordErr = "Wachtwoorden matchen niet";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["streetname"])) {
|
||||||
|
$streetnameErr = "Straatnaam is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!preg_match("/^[a-zA-Z ]*$/",$streetname)) {
|
||||||
|
$streetnameErr = "Alleen letters en spaties zijn toegestaan!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["housenumber"])) {
|
||||||
|
$housenumberErr = "Huisnummer is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($_POST["email"])) {
|
||||||
|
$emailErr = "Email is verplicht!";
|
||||||
|
$correct = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
|
$emailErr = "Geldige email invullen!";
|
||||||
|
$correct = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks if everything is filled in correctly
|
||||||
|
if ($correct == false){
|
||||||
|
$genericErr = "Bepaalde velden zijn verkeerd of niet ingevuld!";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$servername = "agile136.science.uva.nl";
|
||||||
|
$username = "mhbp";
|
||||||
|
$password = "qdtboXhCHJyL2szC";
|
||||||
|
|
||||||
|
// Creates connection
|
||||||
|
$conn = new mysqli($servername, $username, $password);
|
||||||
|
|
||||||
|
// Checks connection
|
||||||
|
if ($conn->connect_error) {
|
||||||
|
die("Connection failed: " . $conn->connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query for inserting all the data in the database
|
||||||
|
$sql = "INSERT INTO
|
||||||
|
VALUES ($name, $surname, $bday, $username, $password,
|
||||||
|
$confirmpassword, $streetname, $housenumber, $email)";
|
||||||
|
|
||||||
|
// Checks if able to insert into database
|
||||||
|
if (mysqli_query($conn, $sql)) {
|
||||||
|
echo "New record created successfully";
|
||||||
|
} else {
|
||||||
|
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/* Execute a prepared statement by binding PHP variables */
|
||||||
|
$calories = 150;
|
||||||
|
$colour = 'red';
|
||||||
|
$sth = $dbh->prepare('SELECT name, colour, calories
|
||||||
|
FROM fruit
|
||||||
|
WHERE calories < :calories AND colour = :colour');
|
||||||
|
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
|
||||||
|
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
|
||||||
|
$sth->execute();
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Closing connection
|
||||||
|
mysql_close($connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This view adds register view */
|
||||||
|
include("../views/register-view.php");
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,98 +1,117 @@
|
|||||||
::selection {
|
::selection {
|
||||||
background: #845663;
|
background: #845663;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-moz-selection {
|
::-moz-selection {
|
||||||
background: #845663;
|
background: #845663;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
a, a:link, a:visited, a:hover, a:active {
|
a, a:link, a:visited, a:hover, a:active {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.button {
|
||||||
|
background-color: #845663;
|
||||||
|
border: 2px solid black;
|
||||||
|
border-radius: 12px;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 50%;
|
||||||
|
margin: 8px 0;
|
||||||
|
padding: 14px 20px;
|
||||||
|
width: 25%;
|
||||||
|
font-family: Arial;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
a[data-title]:hover:after, img[data-title]:hover:after, span[data-title]:hover:after,
|
a[data-title]:hover:after, img[data-title]:hover:after, span[data-title]:hover:after,
|
||||||
div[data-title]:hover:after{
|
div[data-title]:hover:after{
|
||||||
content: attr(data-title);
|
content: attr(data-title);
|
||||||
padding: 4px 4px;
|
padding: 4px 4px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
-moz-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
-webkit-border-radius: 5px;
|
-webkit-border-radius: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
-moz-box-shadow: 0px 0px 4px #222;
|
-moz-box-shadow: 0px 0px 4px #222;
|
||||||
-webkit-box-shadow: 0px 0px 4px #222;
|
-webkit-box-shadow: 0px 0px 4px #222;
|
||||||
box-shadow: 0px 0px 4px #222;
|
box-shadow: 0px 0px 4px #222;
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add Zoom Animation */
|
/* Add Zoom Animation */
|
||||||
.animate {
|
.animate {
|
||||||
animation: animatezoom 0.6s
|
animation: animatezoom 0.6s
|
||||||
-webkit-animation: animatezoom 0.6s;
|
-webkit-animation: animatezoom 0.6s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Body */
|
/* Body */
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 900px;
|
||||||
|
|
||||||
background-color: #B78996;
|
background-image: url(https://images2.pixlis.com/background-image-plaid-checkered-seamless-tileable-235ftm.png);
|
||||||
color: #333;
|
background-size: contain;
|
||||||
|
background-attachment: fixed;
|
||||||
|
|
||||||
font-family: Arial, sans-serif;
|
/*background-color: #B78996;*/
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stijl voor alle buttons */
|
/* stijl voor alle buttons */
|
||||||
button {
|
button {
|
||||||
background-color: #845663;
|
background-color: #845663;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 50%;
|
height: 50%;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
padding: 14px 20px;
|
padding: 14px 20px;
|
||||||
width: 25%;
|
width: 25%;
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The Close Button */
|
/* The Close Button */
|
||||||
.close {
|
.close {
|
||||||
/* Position it in the top right corner outside of the modal */
|
/* Position it in the top right corner outside of the modal */
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 100px;
|
font-size: 100px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 25px;
|
right: 25px;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close button on hover */
|
/* Close button on hover */
|
||||||
.close:hover,
|
.close:hover,
|
||||||
.close:focus {
|
.close:focus {
|
||||||
color: red;
|
color: red;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inlogform */
|
/* inlogform */
|
||||||
form {
|
form {
|
||||||
background-color: #a87a87;
|
/*background-color: #a87a87;*/
|
||||||
border: 5px solid #325da3;
|
border: 5px solid #325da3;
|
||||||
|
background-color: #a87a87;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
height: 50%;
|
height: 57%;
|
||||||
margin: auto;
|
margin: 8px auto;
|
||||||
width: 55%;
|
width: 45%;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inlog titel */
|
/* inlog titel */
|
||||||
@@ -142,14 +161,21 @@ label {
|
|||||||
|
|
||||||
/* padding voor registreer container */
|
/* padding voor registreer container */
|
||||||
.login_containerregister {
|
.login_containerregister {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* padding voor login_containers */
|
/* padding voor login_containers */
|
||||||
.login_containerlogin {
|
.login_containerlogin {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* padding voor foutmelding login */
|
||||||
|
.login_containerfault {
|
||||||
|
padding: 16px;
|
||||||
|
text-align: center;
|
||||||
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The Modal (background) */
|
/* The Modal (background) */
|
||||||
@@ -175,12 +201,13 @@ label {
|
|||||||
margin: 5px auto; /* 15% from the top and centered */
|
margin: 5px auto; /* 15% from the top and centered */
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: 40%; /* Could be more or less, depending on screen size */
|
width: 40%; /* Could be more or less, depending on screen size */
|
||||||
height: 80%;
|
height: 60%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes animatezoom {
|
@keyframes animatezoom {
|
||||||
from {transform: scale(0)}
|
from {transform: scale(0)}
|
||||||
to {transform: scale(1)}
|
to {transform: scale(1)}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* datepicker */
|
/* datepicker */
|
||||||
@@ -203,6 +230,6 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,256 +1,49 @@
|
|||||||
<?php
|
|
||||||
// define variables and set to empty values
|
|
||||||
$name = $surname = $bday = $username = $password = $confirmpassword = $streetname = $housenumber = $email = "";
|
|
||||||
$passwordErr = $confirmpasswordErr = "";
|
|
||||||
$correct = true;
|
|
||||||
|
|
||||||
if (isset($_POST["name"])) {
|
|
||||||
$name = $_POST["name"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["surname"])) {
|
|
||||||
$surname = $_POST["surname"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["bday"])) {
|
|
||||||
$bday = $_POST["bday"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["username"])) {
|
|
||||||
$username = $_POST["username"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["password"])) {
|
|
||||||
$password = $_POST["password"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["streetname"])) {
|
|
||||||
$streetname = $_POST["streetname"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["housenumber"])) {
|
|
||||||
$housenumber = $_POST["housenumber"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST["email"])) {
|
|
||||||
$email = $_POST["email"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
||||||
if ($_POST["password"]!= $_POST["confirmpassword"]) {
|
|
||||||
$passwordErr = "Wachtwoorden matchen niet";
|
|
||||||
$confirmpasswordErr = "Wachtwoorden matchen niet";
|
|
||||||
$correct = false;
|
|
||||||
?>
|
|
||||||
<script>window.onload = function() {
|
|
||||||
document.getElementById('id01').style.display='block'
|
|
||||||
}</script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div>
|
<div>
|
||||||
<img style="width:50%;margin-left:25%"
|
<img style="width:50%;margin-left:25%"
|
||||||
src="img/top-logo.png"
|
src="img/top-logo.png"
|
||||||
alt="MyHyvesbook+">
|
alt="MyHyvesbook+">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="../profile.php"
|
<!-- Login content -->
|
||||||
|
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
|
||||||
|
return= $correct
|
||||||
method="post">
|
method="post">
|
||||||
<h1>Welkom bij MyHyvesbook+</h1>
|
<h1>Welkom bij MyHyvesbook+</h1>
|
||||||
|
|
||||||
|
<!-- Login name -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<label><b>Gebruikersnaam</b></label>
|
<label><b>Gebruikersnaam</b></label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
placeholder="Voer uw gebruikersnaam in"
|
placeholder="Voer uw gebruikersnaam in"
|
||||||
name="uname"
|
name="uname"
|
||||||
pattern=".{6,}"
|
value="<?php echo $uname ?>"
|
||||||
title="Moet 6 of meer karakters bevatten"
|
title="Moet 6 of meer karakters bevatten"
|
||||||
required>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Login password -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<label><b>Wachtwoord</b></label>
|
<label><b>Wachtwoord</b></label>
|
||||||
<input type="password"
|
<input type="password"
|
||||||
placeholder="Voer uw wachtwoord in"
|
placeholder="Voer uw wachtwoord in"
|
||||||
name="psw"
|
name="psw"
|
||||||
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
|
|
||||||
title="Moet minimaal 1 cijfer, hoofdletter en kleine letter bevatten en minstens 8 karakters lang zijn"
|
title="Moet minimaal 1 cijfer, hoofdletter en kleine letter bevatten en minstens 8 karakters lang zijn"
|
||||||
required>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Error message -->
|
||||||
|
<div class="login_containerfault"><span><?php echo $loginErr; ?></span></div>
|
||||||
|
|
||||||
|
<!-- Button for logging in -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<input type="submit"
|
<input type="submit"
|
||||||
value="Login"
|
value="Login"
|
||||||
name="Submit"
|
name="submit"
|
||||||
id="frm1_submit" />
|
id="frm1_submit" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<!-- Button for going to the register screen -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<button onclick="document.getElementById('id01').style.display='block'">Registreer</button>
|
<a href="https://myhyvesbookplus.nl/~joey/public/register.php" class="button">Registreer een account</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<div id="id01" class="modal">
|
|
||||||
<span onclick="document.getElementById('id01').style.display='none'"
|
|
||||||
class="close"
|
|
||||||
title="Close Modal">
|
|
||||||
×</span>
|
|
||||||
|
|
||||||
<!-- Register Content -->
|
|
||||||
<form class="modal-content animate"
|
|
||||||
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
|
|
||||||
return= $correct
|
|
||||||
method="post">
|
|
||||||
<h2>Registreer uw account</h2>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Naam</b></label>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="Voer uw naam in"
|
|
||||||
name="name"
|
|
||||||
value="<?php echo $name ?>"
|
|
||||||
pattern="[A-Za-z]{1,}"
|
|
||||||
title="Mag alleen letters bevatten"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Achternaam</b></label>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="Voer uw achternaam in"
|
|
||||||
name="surname"
|
|
||||||
value="<?php echo $surname ?>"
|
|
||||||
pattern="[A-Za-z]{1,}"
|
|
||||||
title="Mag alleen letters bevatten"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Geboortedatum</b></label>
|
|
||||||
<input type="date"
|
|
||||||
name="bday"
|
|
||||||
value="<?php echo $bday ?>"
|
|
||||||
id="bday"
|
|
||||||
placeholder="01/01/1900">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Gebruikersnaam</b></label>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="Voer uw gebruikersnaam in"
|
|
||||||
name="username"
|
|
||||||
value="<?php echo $username ?>"
|
|
||||||
pattern=".{6,}"
|
|
||||||
title="Moet minstens 6 karakters bevatten"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Minstens 6 karakters</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Wachtwoord</b></label>
|
|
||||||
<input type="password"
|
|
||||||
placeholder="Voer uw wachtwoord in"
|
|
||||||
name="password"
|
|
||||||
value="<?php echo $password ?>"
|
|
||||||
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
|
|
||||||
id="password"
|
|
||||||
title="Moet minimaal 1 cijfer, hoofdletter en kleine letter bevatten en minstens 8 karakters bevatten"
|
|
||||||
required>
|
|
||||||
<span class="error">* <?php echo $passwordErr;?></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Minstens 8 karakters</li>
|
|
||||||
<li>Minimaal 1 cijfer</li>
|
|
||||||
<li>Minimaal 1 hoofdletter</li>
|
|
||||||
<li>Minimaal 1 kleine letter</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Herhaal wachtwoord</b></label>
|
|
||||||
<input type="password"
|
|
||||||
placeholder="Herhaal wachtwoord"
|
|
||||||
name="confirmpassword"
|
|
||||||
value="<?php echo $confirmpassword ?>"
|
|
||||||
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
|
|
||||||
id="confirmpassword"
|
|
||||||
title="Herhaal wachtwoord"
|
|
||||||
required>
|
|
||||||
<span class="error">* <?php echo $confirmpasswordErr;?></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Straatnaam</b></label>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="Voer uw straatnaam in"
|
|
||||||
name="streetname"
|
|
||||||
value="<?php echo $streetname ?>"
|
|
||||||
pattern="[A-Za-z]{1,}"
|
|
||||||
title="Mag alleen letters bevatten"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Huisnummer</b></label>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="Voer uw straatnummer in"
|
|
||||||
name="housenumber"
|
|
||||||
value="<?php echo $housenumber ?>"
|
|
||||||
pattern="[1-9][0-9]{0,}"
|
|
||||||
title="Mag alleen nummers bevatten"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<label><b>Email</b></label>
|
|
||||||
<input type="email"
|
|
||||||
placeholder="Voer uw email in"
|
|
||||||
name="email"
|
|
||||||
value="<?php echo $email ?>"
|
|
||||||
id="email"
|
|
||||||
title="Voer een geldige email in"
|
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="login_containerregister">
|
|
||||||
<input type="submit"
|
|
||||||
value="Registreer uw account"
|
|
||||||
name="Submit"
|
|
||||||
id="frm1_submit" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Get the modal
|
|
||||||
var modal = document.getElementById('id01');
|
|
||||||
// When the user clicks anywhere outside of the modal, close it
|
|
||||||
window.onclick = function(event) {
|
|
||||||
if (event.target == modal) {
|
|
||||||
modal.style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function passwordfunction() {
|
|
||||||
var password1 = document.getElementById("password").value;
|
|
||||||
var password2 = document.getElementById("confirmpassword").value;
|
|
||||||
var passwordmatching = false;
|
|
||||||
|
|
||||||
if (password1 == password2) {
|
|
||||||
document.getElementById("password").style.borderColor = "red";
|
|
||||||
document.getElementById("confirmpassword").style.borderColor = "red";
|
|
||||||
confirmpassword.setCustomValidity("Wachtwoorden matchen niet")
|
|
||||||
} else {
|
|
||||||
passwordmatching = true;
|
|
||||||
}
|
|
||||||
return passwordmatching;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -5,6 +5,4 @@
|
|||||||
type="text/css"
|
type="text/css"
|
||||||
href="styles/index.css">
|
href="styles/index.css">
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||||
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
|
|
||||||
<script src="js/dobPicker.min.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
145
website/views/register-view.php
Normal file
145
website/views/register-view.php
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<div>
|
||||||
|
<img style="width:50%;margin-left:25%"
|
||||||
|
src="img/top-logo.png"
|
||||||
|
alt="MyHyvesbook+">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register Content -->
|
||||||
|
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
|
||||||
|
return= $correct
|
||||||
|
method="post">
|
||||||
|
<h2>Registreer uw account</h2>
|
||||||
|
|
||||||
|
<!-- Error message -->
|
||||||
|
<div class="login_containerfault"><?php echo $genericErr;?></span></div>
|
||||||
|
|
||||||
|
<!-- Register name -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Naam</b></label>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Voer uw naam in"
|
||||||
|
name="name"
|
||||||
|
value="<?php echo $name ?>"
|
||||||
|
title="Mag alleen letters bevatten"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $nameErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register surname -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Achternaam</b></label>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Voer uw achternaam in"
|
||||||
|
name="surname"
|
||||||
|
value="<?php echo $surname ?>"
|
||||||
|
title="Mag alleen letters bevatten"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $surnameErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register birthday -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Geboortedatum</b></label>
|
||||||
|
<input type="date"
|
||||||
|
name="bday"
|
||||||
|
value="<?php echo $bday ?>"
|
||||||
|
id="bday"
|
||||||
|
placeholder="01/01/1900"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $bdayErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register username -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Gebruikersnaam</b></label>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Voer uw gebruikersnaam in"
|
||||||
|
name="username"
|
||||||
|
value="<?php echo $username ?>"
|
||||||
|
title="Moet minimaal 6 karakters bevatten"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $usernameErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Minstens 6 karakters</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Register password -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Wachtwoord</b></label>
|
||||||
|
<input type="password"
|
||||||
|
placeholder="Voer uw wachtwoord in"
|
||||||
|
name="password"
|
||||||
|
value="<?php echo $password ?>"
|
||||||
|
id="password"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $passwordErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Minstens 8 karakters</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Repeat password -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Herhaal wachtwoord</b></label>
|
||||||
|
<input type="password"
|
||||||
|
placeholder="Herhaal wachtwoord"
|
||||||
|
name="confirmpassword"
|
||||||
|
value="<?php echo $confirmpassword ?>"
|
||||||
|
id="confirmpassword"
|
||||||
|
title="Herhaal wachtwoord"
|
||||||
|
>
|
||||||
|
<span class="error">* <?php echo $confirmpasswordErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register streetname -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Straatnaam</b></label>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Voer uw straatnaam in"
|
||||||
|
name="streetname"
|
||||||
|
value="<?php echo $streetname ?>"
|
||||||
|
pattern="[A-Za-z]{1,}"
|
||||||
|
title="Mag alleen letters bevatten">
|
||||||
|
<span class="error">* <?php echo $streetnameErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register housenumber -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Huisnummer</b></label>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Voer uw straatnummer in"
|
||||||
|
name="housenumber"
|
||||||
|
value="<?php echo $housenumber ?>"
|
||||||
|
pattern="[1-9][0-9]{0,}"
|
||||||
|
title="Mag alleen nummers bevatten">
|
||||||
|
<span class="error">* <?php echo $housenumberErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Register email -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<label><b>Email</b></label>
|
||||||
|
<input type="email"
|
||||||
|
placeholder="Voer uw email in"
|
||||||
|
name="email"
|
||||||
|
value="<?php echo $email ?>"
|
||||||
|
id="email"
|
||||||
|
title="Voer een geldige email in">
|
||||||
|
<span class="error">* <?php echo $emailErr;?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Button for registering -->
|
||||||
|
<div class="login_containerregister">
|
||||||
|
<input type="submit"
|
||||||
|
value="Registreer uw account"
|
||||||
|
name="Submit"
|
||||||
|
id="frm1_submit" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Button for going back to login screen -->
|
||||||
|
<div class="login_containerlogin">
|
||||||
|
<a href="https://myhyvesbookplus.nl/~joey/public/login.php" class="button">Login met een account</a>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user