I have the following code:
include_once("../content/includes/connect.php");
include_once("_functions.php");
//TODO: support sending variables
$check = true;
$callback = "error";
foreach ($_GET as $key => $value) {
echo "Key: {$key}<br>";
echo "Value: {$value}<br>";
echo "<pre>";
print_r(checkRules("register", $key, $value));
echo "</pre>";
list($pass, $errormessage) = checkRules("register", $key, $value);
echo "Pass: {$pass}<br>";
echo "Errormessage: {$errormessage}<br><br>";
if (!$pass) {
$check = false;
$callback = "error";
break;
}
}
if ($check) {
$callback = "register_success";
}
echo json_encode(array(
"callback" => $callback
));
SQL::close();
And this gives me the following HTML page:
Key: email
Value: [email protected]
Array
(
[pass] => 1
[errormessage] =>
)
Pass:
Errormessage:
{"callback":"error"}
Now I do not get why the list($pass, $errormessage) = checkRules("register", $key, $value); does not work, when I clearly see that with print_r() it has the results.
list($pass, $errormessage)assignment.