cpsess of cPanel Secure Remote Login
i'm starting on cPanel API and have a problem, this is my code:
$user = 'username';
$pass = 'password';
$host = 'xxx.xxx.xxx.xxx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
$header[0] = "Authorization: Basic " . base64_encode($user . ":" . $pass) . "\n\r";
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_PORT, 2083);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&pass=$pass");
curl_setopt($ch, CURLOPT_TIMEOUT, 100020);
$f = curl_exec($ch);
$h = curl_getinfo($ch);
echo $h['url">;
curl_close($ch);
this code show: "
-
Hello, The following document offers information about authenticating when using our API: Guide to API Authentication - Software Development Kit - cPanel Documentation Review the "Single Sign On" and "Secure Remote Logins" section to determine which option works best for the custom script you are developing. We're happy to provide further clarifications, or answer any additional questions you have. Thanks! 0
Please sign in to leave a comment.
Comments
1 comment