The curl extension of php can be used to open remote webpages by both GET and POST methods. There are many situations when you need a php script to login into a website and open a certain page. All that is required is a valid URL, username, and password for the successful authorization.
The following class enables successful login to a remote site with a username and password, which are protected variables in the class. In this case stop cURL from verifying the peer's certificate, and the connection is made to https protocol.
For cURL additional options or a description of each option can be found on the curl_setopt link on the official php website.
Visit on page: https://dev-all.eu/blog/login-with-curl-php-on-remote-website