Forum Moderators: coopster
Here's what I need to do: Setup a simple zip code search form that will execute a script. A user enters the zip code and it redirects them to one of four pages which is associated with different zip codes (in the state of Georgia). If they enter a zip code that's not on the list, it would redirect them to a page that says something like "this zip code is not a part of the area....etc.". I know how to set up the form to execute the script, just don't know what the script itself should be. I'm assuming I won't need to use a DB, and that the zips would be in the script itself. Here is what i have so far:
Here is the form code to call up the script:
<form name="" method="post" action="redirect.php">
<input name="zip" type="text" id="zip" size="10">
<input type="submit" name="Submit" value="Go">
<br>
</form>
redirect.php is the script file of course. Contains th e following code:
<?php
$url = '';
switch ($zip) {
case "30002":
case "30012":
case "30013":
case "30014":
case "30015":
case "30016":
case "30017":
case "30018":
case "30021":
case "30025":
case "30030":
case "30031":
case "30032":
case "30033":
case "30034":
case "30035":
case "30036":
case "30037":
case "30038":
case "30039":
case "30047":
case "30048":
case "30052":
case "30054":
case "30055":
$url = '/redirect.php';
break;
default:
$url = '/login.php';
break;
}
header("Location:" . $url);
?>
But nothing happens ---- just goes to the redirect.php page
[edited by: coopster at 11:28 pm (utc) on Nov. 19, 2008]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]