I am trying to pull content from a national weather service page into my own site. This is the code that I’m using…
[php]<?php
$fname = “http://forecast.weather.gov/MapClick.php?CityName=Little+Rock&state=AR&site=LZK&textField1=34.7224&textField2=-92.3541&e=1”;
$content = file_get_contents($fname);
echo $content;
?>
[/php]
The problem is that image links from the imported page are all relative causing the browser to look for them on my server. adding the snippet
[php]echo “<base href=“http://forecast.weather.gov” />”;[/php]
works in firefox but not in IE since it is supposed to located in the of the page. However putting it in the breaks all other links on the page.
Is there any way to set a base href just for the code being pulled in by php?