Thread: PHP Validation
View Single Post
Old 10-25-2006, 08:49 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,486
sde is on a distinguished road
just iterate and change the string of the post array
PHP Code:
<?php
$bad_data 
= array('03-''04-''05-''06-''07-''08-''09-''012''013''016''017''019''E10''E20''E30''RM1''RM2''RM3''RM4''RM5''RM6''RM7''RM8''RM9''012-''013-''016-''017-''019-');

for (
$i=1$i<5$i++) {
    if (
in_array(strtoupper($_POST['Text_Box_'.$i]), $bad_data)) {
    
        die(
'This keyword is disallowed. Please click the BACK button of your browser & change your search criteria to something else. Thanks :-)');
    }
}
?>
__________________
Mike
sde is offline   Reply With Quote