Forum Moderators: coopster

Message Too Old, No Replies

Using php to dynamically alter url

obtaining rss feeds thru url

         

CNibbana

1:51 am on Sep 23, 2004 (gmt 0)

10+ Year Member



I'm trying to utilize a public news providers RSS feed on my site, while allowing my visitors to access their local news with their zip code.

My objective is to figure out how to get the city and state as variables to be used within the RSS formatted URL. This way I can query the feed with a zip code and have a script convert it to city & state.

If you format the URL as follows:
http://domain/search?jumpsearch=1&jq=XXXXX (where X=zipcode)

The site will query the city and state and return a page with local news and the following URL format:
http://domain/city/CITY-ST (example: Baltimore-MD)

In order to get an RSS feed, the site requires the city and state URL and will not accept a zip code version:
http://domain/rss/city/CITY-ST.xml (and notice the added rss subdirectory)

HERE IS THE QUESTION I NEED ANSWERED:
Is it possible to conduct the initial page request 'behind the scenes' with PHP and get the resulting URL as a variable? Then I can parse and reconstruct the resulting URL into the RSS required format.

IanKelley

2:57 am on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There really isn't anything you can't do with PHP (or other server side languages).

However, before you can consider writing scripts like this you have to learn the basics. php.net is a good place to start.

CNibbana

11:00 am on Sep 23, 2004 (gmt 0)

10+ Year Member



I figured out how to do it. Thanks.