stevewilliams Posted June 3, 2010 Share Posted June 3, 2010 I have some simple hooks that work fine when run as a standalone php file. I have one hook at "ClientAdd" and another at "ClientDelete". WHMCS works fine by itself and the hooks work fine as code by themselves, but when the script is used as a hook, the hook runs just fine, but WHMCS shows that the new client purchased 0 products/services when they did. When I delete that client from within WHMCS, the hook runs just fine but the client still remains. If I remove these hooks, WHMCS works fine. I am thinking that WHMCS stops running to perform the hook action, but never resumes doing whatever it should, so the entire new client purchase is not logged, and the client never seems to be able to be deleted. Has anyone run into a similar problem or have any suggestions to solve this issue? Thank you so much for any help in advance! 0 Quote Link to comment Share on other sites More sharing options...
stevewilliams Posted June 4, 2010 Author Share Posted June 4, 2010 I just added the most simple hook: <?php function please_work($vars) { // Make database connection $con = mysql_connect("localhost", "user", "pass"); //echo "1. Connected to MySQL<br />"; mysql_select_db("db") or die(mysql_error()); //echo "2. Connected to Database<br />"; mysql_close($con); } // end function add_hook("ClientAdd",1,"please_work"); ?> Just doing something like this causes WHMCS to not function properly. If I use this, it will show that the client purchased 0 products/services. If I use this same hook at "ClientDelete", I am not able to delete the client in WHMCS. Each time you click delete client, it just takes you back to the clients page and the client is still there! Could someone PLEASE try to help me figure out why the simplest hooks are messing up my WHMCS functionality??!!? 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.