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
Dynamically modify web pages
Moderator: General Moderators
-
rowan.bradley
- Forum Newbie
- Posts: 3
- Joined: Sun Jan 13, 2008 7:09 am
Re: Dynamically modify web pages
You're treading on some dangerous ground here. Do you have the authority to use and modify pages at this other server?
-
rowan.bradley
- Forum Newbie
- Posts: 3
- Joined: Sun Jan 13, 2008 7:09 am
Re: Dynamically modify web pages
>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
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
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Dynamically modify web pages
"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.
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.
-
rowan.bradley
- Forum Newbie
- Posts: 3
- Joined: Sun Jan 13, 2008 7:09 am
Re: Dynamically modify web pages
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
Can we get back to the technology - is this posible, and how? The ethics of it is a different topic...
Rowan
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Dynamically modify web pages
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