PHP、Zend Framework:如何从另一台服务器获取页面,然后传递内容?
我想这也可以称为“抓取”。基本上,我想做的是,如果有人点击此链接:
<a href="/links/display/id/47">Click here</a>
我希望我的 links
控制器、display
操作:
- 从数据库中查找链接 #47 的实际 url (即 http://www.google.com),
- 获取/抓取内容,
- 将内容显示在浏览器就好像它来自我的应用程序一样。
我希望浏览器窗口将 http://myapp.com/links/display/id/47
显示为浏览器窗口中的位置。这样,如果用户(未经身份验证)请求查看此页面,他们将被发送到登录屏幕。
有关我为什么要这样做的更多信息,参考这个问题。
I think this might also be referred to as "scraping". Basically, what I want to do, is if someone clicks this link:
<a href="/links/display/id/47">Click here</a>
I want my links
controller, display
action to:
- find the actual url of link #47 from the database (i.e. http://www.google.com),
- fetch/scrape the content,
- display the content in the browser as if it came from my application.
I want the browser window to display http://myapp.com/links/display/id/47
as the location in the browser window. That way, if a user (who has not been authenticated) requests to view this page, they will be sent to the login screen.
For more information on why I would want to do this, refer to this question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Zend_Http_Client,发送请求,获取响应:)
Zend_Http_Client, send request, get response :)