Fejl på validering af form
Jeg har lavet et lille tjek på en form... Og der er sådan set 2 problemer...1. mine if sætninger virker kun på $tlf og postnr!!! Hvorfor?
2. strlen() virker slet ikke!
$navn = $_POST[navn];
$adresse = $_POST[adresse];
$postnr = $_POST[postnr];
$tlf = $_POST[tlf];
if($navn==null){
header("Location: crud.php?part=division&fejl=1");
}
if($adresse==null){
header("Location: crud.php?part=division&fejl=2");
}
if($postnr==null){
header("Location: crud.php?part=division&fejl=3");
}
if((strlen($postnr)<4)||(!is_numeric($postnr))){
header("Location: crud.php?part=division&fejl=4");
}
if($tlf==null){
header("Location: crud.php?part=division&fejl=5");
}
if((strlen($tlf)<8)||(!is_numeric($tlf))){
header("Location: crud.php?part=division&fejl=6");
}
