Jump to content

DaveK

Retired Forum Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by DaveK

  1. I tried to set the passwords during as mass imports using the addClient function to no luck. I have as a result attempted to use the following code to try and update a client's password. It returns success, but any password I put in it, whether it be a text string or a variable does NOT work. Assume the url, username, and clientid and password to be correct, as it connects and states that it was successful in the $results["result"] variable. <? $url = ""; # URL to WHMCS API file $username = ""; # Admin username goes here $password = ""; # Admin password goes here $postfields["username"] = $username; $postfields["password"] = md5($password); $postfields["action"] = "updateclient"; $postfields["clientid"] = ""; $postfields["password2"] = "demo1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); print_r ($data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! print "Account Updated"; } else { echo 'error!'.$results["result"];} ?> so after the update, the password should be demo1, correct? Not the case.
  2. I'm trying to create an import script for a proprietary system, which has each order listed as an individual package. I was wondering how to automatically add a product, and set it's recurring payment to a unique amount per product, per client (clients registered at different times have different prices due to promotions) Edit: It seems like the sql table "tblhosting" has most of this info, however I was unsure how to link this to an orderid.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated