Page 1 of 1

Trying to get php to use an entered zip to $_GET a URL

Posted: Fri Apr 24, 2009 8:57 am
by MunsoonEnterprises
I am new to PHP, and I LOVE IT!. I have a web page with a form that you enter a zip code. I have the action set to process.php.
My problem is I can not find, anywhere in my tutorials how to get the entered zip code to bring you to a different page on the site.

I need each zip code to bring you to a certain page.

or if that zip code does not = a value with a page, it will go to a generic page.

Can anyone please help me, My site has to launch very soon.

MOON

Re: Trying to get php to use an entered zip to $_GET a URL

Posted: Fri Apr 24, 2009 9:54 am
by Cryophallion
First, make sure you validate the data.

Then you can use the Header function, with the Location: to redirect to a new url:
http://us2.php.net/manual/en/function.header.php

you may need output buffering if you have already sent headers.

Try the lynda.com tutorials - very thorough, and they deal with this too.