PHP镜像网页
我正在尝试创建一个用于网站的天气小部件的镜像。目前,它在 HTTPS 页面上使用,但小部件服务器不支持(并且 IE 会通过对话框发脾气,因为小部件不是 HTTPS)
为了解决这个问题,我想做的是镜像 HTTPS 中的页面以静音安全警告。我通常会使用 file_get_contents()
来实现此目的,但是该页面包含图像,这使其变得更加复杂。
**另外,作为旁注,我的网站或他们的网站上没有任何广告,因此没有收入窃取
I am trying to create a mirror of a weather widget which I use for a website. Presently, it is used on an HTTPS page, but widget server does not support that (and IE throws a tantrum with dialogs because the widget is not HTTPS)
To solve this, I would like to do is mirror the page in HTTPS to silence the security warnings. I would normally use file_get_contents()
for this, however the page contains images which makes it a little more complicated.
**Also as a side note, there isn't any ads on my website or theirs, so there is no revenue stealing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 CURL 抓取页面的内容(图像和所有内容)。您可以将其放入文件中,然后使用该 URL 代替您使用小部件 URL 的位置:
请参阅文档:http://www.php.net/manual/en/function.curl-exec.php
Use CURL to grab a page's content (images and all). You can put this in a file, then use that URL in place of where you'd use the widget's URL:
See the docs: http://www.php.net/manual/en/function.curl-exec.php