Displaying Logged in Content on a Website

前端 未结 1 1366
無奈伤痛
無奈伤痛 2020-12-21 12:26

I\'m not quite sure how to describe this in words without making it overly complex, so here is basically what I want to happen:

  1. The user goes to my website, le
相关标签:
1条回答
  • 2020-12-21 12:52

    It sounds like you might be looking for cURL and cookiejar:

    http://curl.haxx.se/libcurl/php/examples/cookiejar.html

    This will allow you to programmatically login to a site, keep a session open, and then access the login protected content. Once you get the page contents, then you can use DomDocument (http://us2.php.net/manual/en/domdocument.loadhtml.php) to access the content you need and turn it into RSS data.

    Edit: if the website uses form keys, like many do, this will require extra work to extract the form key from the login page and add it to the login POST

    0 讨论(0)
提交回复
热议问题