I would like to make a php script that can capture a page from a website. Think file_get_contents($url).
However, this website requires that you fill in a username/password log-in form before you can access any page. I imagine that once logged-in, the website sends your browser an authentication cookie and with every consequent browser request, the session info is passed back to the website to authenticate access.
I want to know how i can simulate this behavior of the browser with a php script in order to gain access and capture a page from this website.
More specifically, my questions are:
- How do I send a request that contains my log-in details so that the website replies with the session information/cookie
- How do i read the session information/cookie
- How do i pass back this session information with every consequent request (file_get_contents, curl) to the website.