webix Posted June 26, 2019 Share Posted June 26, 2019 Hello folks! I am developping a custom control panel for my users to manage their IP addresses (rDNS, etc...). I want they use their email address and password from WHMCS to login on the panel. In order to do that, i made a login form that will pass the POST data (email and password hashed in MD5) to the following function: function validate_login($email, $password) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://XXX.XXXXXXX.XXX/includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query( array( 'action' => 'ValidateLogin', // See https://developers.whmcs.com/api/authentication 'username' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'password' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXxxXX', 'email' => $username, 'password2' => $password, 'responsetype' => 'json', ) ) ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); return curl_exec($ch); curl_close($ch); } The problem is that the function returns in error with the message "Email or Password Invalid". Anyone can help me out to find the error? Best regards 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.