Logged in scraping with PHP and Curl

The general idea is to first make a cookie and scrape the site for a login-form. Then, make a Post-request with the details from the form-scraping and save the session-info to the cookie-file. Finally, use the made cookie to access the content on the server that requires login.

In my example, I'm going to use the student logon-page as an example. After the login is established, I will scrape the study results page to calculate how many points I've acquired between two dates.