Jump to content


Photo

Help with PHP issue...


  • Please log in to reply
4 replies to this topic

#1 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 30 October 2006 - 05:55 PM

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

#2 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 30 October 2006 - 07:00 PM

Anyone?

#3 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 30 October 2006 - 07:34 PM

Can someone atleast point me in the right direction... please...

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 30 October 2006 - 07:55 PM

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

#5 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 30 October 2006 - 08:08 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users