Fixed include checkinput.php

This commit is contained in:
Joey Lai
2017-01-20 11:19:54 +01:00
parent 0389d05e51
commit 5e31590403
3 changed files with 6 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
include("../views/login_head.php"); include("../views/login_head.php");
require_once("../queries/connect.php"); require_once("../queries/connect.php");
include_once("../queries/login.php"); include_once("../queries/login.php");
include_once("../queries/checkInput.php")
?> ?>
<body> <body>
<?php <?php

View File

@@ -29,7 +29,7 @@
} }
checkInputChoice("username", "username"); checkInputChoice("username", "username");
checkInputChoice("password", "longerEigth"); checkInputChoice("password", "longerEight");
checkInputChoice("confirmpassword", ""); checkInputChoice("confirmpassword", "");
matchPassword(); matchPassword();
checkInputChoice("location", "lettersAndSpace"); checkInputChoice("location", "lettersAndSpace");

View File

@@ -1,8 +1,8 @@
<?php <?php
/** /**
* Function for checking inputfields * Function for checking inputfields
* @param variable $example Give name of the inputfield. * @param variable $variable Give name of the inputfield.
* @param string $example2 Give the name of the option. * @param string $option Give the name of the option.
* @return sets correct to false and gives value to error message if it doesn't pass the checks. * @return sets correct to false and gives value to error message if it doesn't pass the checks.
*/ */
function checkInputChoice($variable, $option){ function checkInputChoice($variable, $option){
@@ -21,7 +21,7 @@ function checkInputChoice($variable, $option){
username($variable); username($variable);
break; break;
case "longerEigth"; case "longerEight";
longerEigth($variable); longerEigth($variable);
break; break;
@@ -54,7 +54,7 @@ function username($variable){
} }
/* checks if an input is longer that 8 characters. */ /* checks if an input is longer that 8 characters. */
function longerEigth($variable){ function longerEight($variable){
if (strlen($GLOBALS[$variable]) < 8) { if (strlen($GLOBALS[$variable]) < 8) {
$GLOBALS[$variable . "Err"] = "Moet minstens 8 karakters bevatten"; $GLOBALS[$variable . "Err"] = "Moet minstens 8 karakters bevatten";
$correct = false; $correct = false;