简体   繁体   中英

PHP, Zend Framework: How to fetch a page from another server, then deliver the content?

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:

  1. find the actual url of link #47 from the database (ie http://www.google.com ),
  2. fetch/scrape the content,
  3. 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 .

Zend_Http_Client,发送请求,获取响应:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM