ok the error checking is working for one field. I then put into an array and some thing seems to have "GONE ARRAY". I get no errors so i know the coding is good but i get a $msg of "good" no matter what when i click submit. i don't see what i did wrong probably something simple and/or stupid.
BTW Harley is the best!! Thank you so much for all your help!!!!!!!!!🙂
<?
if ($submit == submit){
$field = array("test", "test1", "test2" ,"test3", "test4", "test5");
for ($i = 1; $i < count($field); $i++) {
if (preg_match("/[a-zA-Z0-9]+$/",($field[$i]))) {
$msg = "good";
} else {
$msg ="not good";
}
}
}
?>
<form method=post action="test.php">
<p> <? echo "$msg"; ?>
<p> input test: <input type=text name="test" size=25>
<p> input test: <input type=text name="test1" size=25>
<p> input test: <input type=text name="test2" size=25>
<p> input test: <input type=text name="test3" size=25>
<p> input test: <input type=text name="test4" size=25>
<p> input test: <input type=text name="test5" size=25>
<p><input type=submit name="submit" value=submit>
</form>