changed location of reexes. hopefully it works..
This commit is contained in:
parent
e8d467bde5
commit
f23fd2f5e9
16
register.php
16
register.php
@ -15,11 +15,7 @@ $pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password')
|
|||||||
<?php
|
<?php
|
||||||
$showFormular = true;
|
$showFormular = true;
|
||||||
|
|
||||||
//regexes for validation:
|
|
||||||
$REuppercase = preg_match('@[A-Z]@', $password);
|
|
||||||
$RElowercase = preg_match('@[a-z]@', $password);
|
|
||||||
$REnumber = preg_match('@[0-9]@', $password);
|
|
||||||
$REspecialChars = preg_match('@[^\w]@', $password);
|
|
||||||
|
|
||||||
if(isset($_GET['register'])) {
|
if(isset($_GET['register'])) {
|
||||||
$error = false;
|
$error = false;
|
||||||
@ -29,7 +25,11 @@ if(isset($_GET['register'])) {
|
|||||||
$lastName = $_POST['lastName'];
|
$lastName = $_POST['lastName'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
$password_confirm = $_POST['password_confirm'];
|
$password_confirm = $_POST['password_confirm'];
|
||||||
|
//regexes for passvalidation:
|
||||||
|
$REuppercase = preg_match('@[A-Z]@', $password);
|
||||||
|
$RElowercase = preg_match('@[a-z]@', $password);
|
||||||
|
$REnumber = preg_match('@[0-9]@', $password);
|
||||||
|
$REspecialChars = preg_match('@[^\w]@', $password);
|
||||||
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
echo 'Please use valid email<br>';
|
echo 'Please use valid email<br>';
|
||||||
$error = true;
|
$error = true;
|
||||||
@ -43,8 +43,8 @@ if(isset($_GET['register'])) {
|
|||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
if(!$REuppercase || !$RElowercase || !$REnumber || !$REspecialChars || strlen($password) < 8) {
|
if(!$REuppercase || !$RElowercase || !$REnumber || !$REspecialChars || strlen($password) < 8) {
|
||||||
echo 'Password needs to be more complex.<br />';
|
echo '<color="red">Password needs to be more complex.</color><br />';
|
||||||
echo 'Please implement at least 8 chars, upper & downer caser, one number & one special char.<br />';
|
echo '<i>Please implement at least 8 chars, upper & downer caser, one number & one special char.</i><br />';
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user