iryaacs Posted February 17, 2017 Share Posted February 17, 2017 I am trying out GetClient Password on External API <?php $url = "http://localhost:81/whmcs/includes/api.php"; # URL to WHMCS API file goes here $username = "admin"; # Admin username goes here $password = "pass"; # Admin password goes here $postfields["username"] = $username; $postfields["password"] = md5($password); $postfields["action"] = "GetClientPassword"; $postfields["userid"] = "1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { echo "Success<br /> <br /> "; # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } ?> Getting an error result=error;message=Invalid IP ***.***.***.*** I already adding the IP in General Setting -> Security Tabs. PN: I am trying this in my Localhost (xampp) What is that I am missing here? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.