martyn1 Posted December 9, 2009 Share Posted December 9, 2009 In the Wiki at http://wiki.whmcs.com/Action_Hooks it shows three parameters to add_hook but in the latest release http://wiki.whmcs.com/Version_4.0_Release_Notes#Action_Hooks it shows 4:- Original Updated I have been trying both methods without much success at the moment and this is one curve ball I would like dismissed so I can move on to the next! Thanks, Martyn 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted December 9, 2009 Share Posted December 9, 2009 "Do add_hook parameters differ between versions?" only in the way you code them. What version of whmcs are you using? if v4.+ then use this http://wiki.whmcs.com/Action_Hooks if you need help then post code you are working on and we can help you more? 0 Quote Link to comment Share on other sites More sharing options...
martyn1 Posted December 9, 2009 Author Share Posted December 9, 2009 Thanks Simon, I am using the 4.12, I had the additional parameter as shown in the changes for 4.12, I'll try it without:- function client_signup($vars) { //Create ventrino client account $syspwd = 'xxxxx'; $url = 'http://www.ventrino.com/dev/client.php'; $postfields["system"] = "create_client"; $postfields["syspwd"] = md5($syspwd); $postfields["name"] = $vars["FirstName"]." ".$vars["LastName"]; $postfields["email"] = $vars["Email"]; $postfields["password"] = $vars["Password"]; $postfields["whmcs_id"] = $vars["ID"]; $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); $results= curl_exec($ch); curl_close($ch); } add_hook("ClientAdd",0,"client_signup"); I have placed it in includes/hooks/client_signup.php Thanks, Martyn 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted December 9, 2009 Share Posted December 9, 2009 I am also just doing a hook and I have also seen I can get some more info by using $_session[..] try printing out sessions. 0 Quote Link to comment Share on other sites More sharing options...
martyn1 Posted December 9, 2009 Author Share Posted December 9, 2009 When I call client_signup($vars) with dummy data it works however it is not being called by WHMCS. I have tried both methods:- add_hook("ClientAdd",0,"client_signup", ""); and add_hook("ClientAdd",0,"client_signup"); Any ideas what else I might try? Thanks, Martyn 0 Quote Link to comment Share on other sites More sharing options...
martyn1 Posted December 9, 2009 Author Share Posted December 9, 2009 "Well it just started working" this way:- add_hook("ClientAdd",0,"client_signup"); The fate spinners are laughing at me today. 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.