Jump to content

Help with PHP issue...


JSHINER

Recommended Posts

Hello,

Right now I have a form, and you enter your zip code. Then:


if(file_exists("/$zip.php"))
{
    include("/$zip.php");
}
else {echo ' Text ';}


However, some towns have multiple zip codes. For example. Town X could have zip codes 00000, 00001, 00002. BUT, there is only ONE zip.php page for each town. So the town's page would be 00000.php.

How do I make it so if you type 00001 or 00002, etc. for your zip, it includes 00000.php.

Thank you,

James
Link to comment
Share on other sites

Hi Ken,

I appreciate your response. I understand you are not here to write code, nor would I expect you to (for free that is).

I first thought about duplicating the 00000.php page so 000001.php would exist, but that brought up the problem that below that include were links to "site.com/$zip/link.php. So that's out of the question.

I also tried if($zip=="00001" || $zip=="00002")... and was going to have that redirect to filename.php?action=search&zip=00000. But that did not work either.

If you could point me in the right direction as to how I can accomplish this, I would greatly appreciate it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.