Added comments to checkinput.php #76

Merged
11057122 merged 1 commits from joey-testing into master 2017-01-20 11:23:42 +01:00
3 changed files with 6 additions and 5 deletions
Showing only changes of commit 5e31590403 - Show all commits

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
<?php
/**
* Function for checking inputfields
* @param variable $example Give name of the inputfield.
* @param string $example2 Give the name of the option.
* @param variable $variable Give name of the inputfield.
* @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.
*/
function checkInputChoice($variable, $option){
@@ -21,7 +21,7 @@ function checkInputChoice($variable, $option){
username($variable);
break;
case "longerEigth";
case "longerEight";
longerEigth($variable);
break;
@@ -54,7 +54,7 @@ function username($variable){
}
/* checks if an input is longer that 8 characters. */
function longerEigth($variable){
function longerEight($variable){
if (strlen($GLOBALS[$variable]) < 8) {
$GLOBALS[$variable . "Err"] = "Moet minstens 8 karakters bevatten";
$correct = false;