On Aug 9, 10:36 am, Maanav Jackson wrote:
> I am displaying a third party webpage into a variable using curl
> library.
> [...] it references all the file path,
> css path, form action path tohttp://localhost/filenamepathOR CSS
> Path or FormAction Path instead ofwww.xyz.com/filepath
Do you have permission from the third party to use his website?
Otherwise it may be unethical, even illegal, to show his page on your
site.
Having said that, the problem is with the HTML. If the HTML references
a file like so:
<img src="foo.jpg" alt="Picture of a Foo" />
Then the browser requests that file from the same server and the same
directory as the referencing page. So if this page is at
http://www.example..com/bar/,
the image should be at
http://www.example.com/bar/foo.jpg.
No need for concern, all you need to do is rewrite all file
references, such as those in image tags, or download all referenced
files to your own server.
Provided you have the approval of the site owner, off course.