PHP is responding that the variable has not been defined (Undefined variable). Use isset to verify that the variable was created.
if( isset( $nome ) )
{
if( $nome == '' OR strlen( $nome ) < 4 )
{
echo 'menor que 4';
}
}
OBS 1. $nome == ''
and $nome === ''
have a different result depending on the typing of the variable, see operators .
OBS2. strlen
does not return the exact string size when it has special characters. Prefer to use mb_strlen to work with strings.
If you want to get a form field, use $_POST['nome_do_campo']
. NEVER use extract in form data. Imagine the scenario below with a user injecting a <input name="pdo" />
<form method="post">
<input name="pdo" />
</form>
$PDO = new PDO( ... );
extract($_POST);
You will lose your PDO instance.