bc90021 wrote:[color=blue]
>
> How can I easily search a web page for relative paths and prepend the FQDN
> to them?
>
> For instance, I send a POST request to a server, and get back the
> resulting page, and store it in a variable called $page.
>
> When I print $page, it prints correctly, but things like the styelsheet
> and images are broken, since they don't reference the site itself.
>
> Ie, $page contains href="/css/stylesheet.css" as part of the code, and I
> need to prepedn "http://www.somesite.com to that so that it gives the full
> path and things aren't broken.[/color]
Stick a <BASE HREF="http://thesiteaddress.com/pathinfo/"> into the <HEAD>er.
Much easier to do and much less work for your server than preging the whole
thing.
Regards,
Shawn
--
Shawn Wilson
shawn@glassgiant.com http://www.glassgiant.com
I have a spam filter. Please include "PHP" in the
subject line to ensure I'll get your message.