Validate user input in login form
parent
3249d249be
commit
588beb3c05
|
@ -1,14 +1,21 @@
|
|||
<?php
|
||||
include_once 'classen/FormValidator.php';
|
||||
|
||||
$HTML = new HTML();
|
||||
$HTML->setHTMLTitle("Login");
|
||||
$HTML->importHTML("style/login/login.html");
|
||||
|
||||
if(isset($_POST['login']))
|
||||
{
|
||||
if(!isset($_POST['username']) || !isset($_POST['password']))
|
||||
{
|
||||
$validator = new FormValidator(array(
|
||||
'username' => array('required' => true, 'regex' => '([^\\\/<>\s]+ [^\\\/<>\s]+){3,255}'),
|
||||
'password' => array('required' => true, 'regex' => '.{1,1000}')
|
||||
));
|
||||
|
||||
if(!$validator->isValid($_POST)) {
|
||||
$HTML->ReplaceLayoutInhalt("%%LOGINMESSAGE%%", "Bitte gebe Benutzername und Passwort an.");
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
$statementUser = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts WHERE FirstName = ? AND LastName = ? LIMIT 1");
|
||||
$statementUser->execute(explode(" ", trim($_POST['username'])));
|
||||
|
||||
|
|
Loading…
Reference in New Issue