Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Problem

Status
Not open for further replies.

HaaDeej

Technical User
Joined
Feb 3, 2005
Messages
7
Location
NL
I have this script. It's a postcode check script, 8911 is now a correct code, but I have to add a few, i've tried everything but i'm not a genious in PHP, maybe someone could help me out. The postcode's that the script has to find "correct" are: 8911 (it's already in the script), 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8921, 8922, 8923, 8924, 8925, 8926, 8931, 8932, 8933, 8934, 8935, 8936, 8937, 8939, 9084.

All the other code's have to be incorrect!


<?php
// postcode check
if($submit){


$patroon = "^([8911]{4}) ([A-Z]{2})$";
if(eregi($patroon, $pc)) {
echo "Postcode is correct";
}

else {
echo "Postcode is not correct";
}

}
else {
?>

<form method=post>
Postcode (8900 AB): <input type='text' name=pc><BR>
<input type=submit name=submit value=check!>
</form>
<?
}
?>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top