I have this code
<?php
ob_start();
header("Content-Type: text/html; charset=ISO-8859-1");
$campo = $_GET['campo'];
$valor = $_GET['valor'];
$hello;
if ($campo == "myPassword") {
if (!preg_match("/^\S{4,12}$/", $valor)) {
echo "Tamanho entre 4 e 12 letras e sem espaços";
}
else
$hello = $valor; //problem here
echo $hello;
}
if ($campo == "passwordMatch") {
if ($hello != $valor ) {
echo "Passwords don't match";
}
}
?>
so, i need to save a variable (where i put "problem here") and compare below, but this code didn't work and i don't know why
$helloa blank string, or do you get PHP exceptions/errors? Try avar_dump($_GET);to ensure you are receiving data if the problem is that$hellois blank.