Page 1 of 1
Dynamically modify web pages
Posted: Tue Sep 22, 2009 5:38 pm
by rowan.bradley
I have a requirement for my web server to receive a page request from a browser (which will contain in some way the URL of a web page on an external web server), to go an fetch the web page from the external server, to make some small changes to it, and then to serve it to the original requesting browser.
Is this possible in PHP? Any hints on how to do this or sample code would be really helpful...
Thanks - Rowan
Re: Dynamically modify web pages
Posted: Tue Sep 22, 2009 7:17 pm
by califdon
You're treading on some dangerous ground here. Do you have the authority to use and modify pages at this other server?
Re: Dynamically modify web pages
Posted: Wed Sep 23, 2009 6:45 am
by rowan.bradley
>Do you have the authority to use and modify pages at this other server
I'm just trying to change the presentation of the data. It's public domain data (i.e. it's all on the existing web site) and I'm not trying to mislead or deceive anyone. I realise there are all sorts of bad reasons for doing this, but mine is a _good_ reason!
Rowan
Re: Dynamically modify web pages
Posted: Wed Sep 23, 2009 6:54 am
by Mark Baker
"public domain data"
Just because the data is published on a web page, doesn't mean that you have a right to modify and republish it at all. The data is still owned (copyright) by the original publisher, and they may not want it republished by anybody else.
Re: Dynamically modify web pages
Posted: Wed Sep 23, 2009 7:23 am
by rowan.bradley
I'm not republishing it - I'm making it available to a small, closed user group.
Can we get back to the technology - is this posible, and how? The ethics of it is a different topic...
Rowan
Re: Dynamically modify web pages
Posted: Wed Sep 23, 2009 7:54 am
by Mark Baker
It's perfectly possible, and there's dozens of questions posted here asking how to retrieve data from other sites. The answer is either curl or file_get_contents if permitted