Jump to content

Archived

This topic is now archived and is closed to further replies.

JSHINER

Help with PHP issue...

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

Share this post


Link to post
Share on other sites
Can someone atleast point me in the right direction... please...

Share this post


Link to post
Share on other sites
Please let us think about this for a while and do not bump sooner than 3 or 4 hours.

What have you tried?

We are not here to write your code, but to help you with code you've already written.

Ken

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.