Hey there.
I want to login to my websites cPanel with cURL and then redirect the user to the cPanel. So far I have the following code:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://mysite.com:2082');
@curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_USERPWD, 'myuser:mypass');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_exec($curl);
header('Location: http://mysite.com:2082');
This does not work, as it still displays the 'enter username and password' box. Is there a way I can make this log the user in and then direct them, without them having to manually enter their username and password?
If you require any additional info please tell me.
Thanks.