Script for secure cPanel login with PHP
Since recently, cPanel has changed the way that it logs in. Before login, the url is : https://accessurl:2083/ After login : https://accessurl:2083/cpsessXXXX/frontend/x3/index.html?post_login=89711792346495 You will note the cpsessXXXX embedded in the url. And the page to access AWSTATS is : https://accessurl:2083/cpsessXXXX/awstats.pl?config=domain_name&ssl=&lang=en I have tried the following PHP code $username = 'xxx'; $password = 'xxx'; $loginUrl = 'https://<accessurl>'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $loginUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT