Jump to content

How To Use Hooks? (Basic level)


ahmad05

Recommended Posts

Hi

i'm realtively new At Whmcs and looking to extend its functionality

i'm not doing anything fancy here i m just trying to run the example hook you provided us with

but it gives me nothing can you guide me how can i run my code through hooks

 

This is what i changed in Example hook

 

if (!defined("WHMCS"))

die("This file cannot be accessed directly");

 

function create_forum_account($vars) {

print_r($vars);

$firstname = $vars['firstname'];

$lastname = $vars['lastname'];

$email = $vars['email'];

 

// Run code to create remote forum account here...

$content = $email;

$fp = fopen("myText.txt","wb");

fwrite($fp,$content);

fclose($fp);

}

 

add_hook("ClientAdd",1,"create_forum_account");

 

Now when i add clied cient through Add new Client page and when i enter "Add new Client" nothing happens andit takes me to Clients summary page is the hook even called?

am i missing something??? Do i need to do some additional stuff ?

Please i really need to know this

Help needed Asap possible

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