Jump to content

My hook messes up WHMCS functionality- PLEASE HELP


stevewilliams

Recommended Posts

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!

Link to comment
Share on other sites

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??!!?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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