views:

115

answers:

2

I have a PHP script that uses CURL to fetch a remote page and return the output as is. It displays fine in the browser, but the problem is, when I click a link it is still using the old base url. Can I force the browser with some kind of HTTP Header or something to use the base url of the server that I fetched the page from in my PHP script?

+3  A: 

If you can inject into the source you could use a base tag and set the href to the base page you want to use.

Quintin Robinson
Works very well thanks
Hannes de Jager
No problem, glad it worked!
Quintin Robinson
+1  A: 

I have a PHP script that uses CURL to fetch a remote page and return the output as is

So do not output it as is, parse and replace URL and only then output it.

Artem Barger