if greater than not working

Hello, This seems like a basic thing, though I can not get it to work

[php]
$username = $_POST[“nusername”]
if (strlen($username)>4){
header(“location: main.php?OK”);
}
{
header(“location: main.php?NOTOK” . strlen($username));
}
[/php]

No matter what I try it always returns false. Even though the strlen($username) shows the correct value.

Looks like you’re missing the else statement

[php]$username = $_POST[“nusername”]
if (strlen($username)>4){
header(“location: main.php?OK”);
}else
{
header(“location: main.php?NOTOK” . strlen($username));
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service