Jump to content


Frequent Contributor
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About yomyyo

  • Rank
    Junior Member
  1. I am adding a hook to my module and testing the hook on my dev whmcs site. In the hook, I am sending a curl request to the dev server of another site. Is there a variable to tell the difference between the whmcs dev site and production site, so that if dev site send a request to dev, and if production site, do the request to production?
  2. I am trying to validate custom fields for my item, but whether or not the custom field is valid, I will be thrown an error. If it's an invalid field it'll say "Please correct the following errors before continuing: This email address is already in use." However if the user gives a valid field, it will just give "Please correct the following errors before continuing:" without anything after. I have the hook set up as so function checkUser($vars){ $postData = array( 'data' => array( 'email' => $vars['customfield'][6], ) ); $ch = curl_init(); if($ch == false){ throw new Exception('failed to init'); } curl_setopt_array($ch, array( CURLOPT_URL => myUrlGoesHere, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HEADER => 0, CURLOPT_POSTFIELDS => http_build_query($postData), )); //Save the result from the request $output = curl_exec($ch); $res = json_decode($output); curl_close($ch); console_log($res); if($res){ $message = "This email address is already in use."; return $message; } } Is there a value I need to return using this hook. Thank you!
  3. Welcome to WHMCS.Community yomyyo! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.


Important Information

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