Jump to content

Need help..simple hooks code


mrascii

Recommended Posts

For some reason, everytime whmcs suspend an account, I need to reach a script, let's say

http://mywebsite.com/sms.cgi?server=$whm_host&account=$account

Where $whm_host value is the server hostname where the suspended account is reside and $account value is the suspended username.

 

But the following code failed to do what I want, I checked mywebsite.com log and seems that the whmcs hooks only reached http://mywebsite.com/sms.cgi?server=&account= which is mean the script failed to get the both server hostname and suspended username value.

 

Anybody can help me? Sorry, I'm PHP newbie.

 

Here's the code I placed into includes/hooks dir.

 

<?php

 

 

define("ACTIONHOOKSINC",true);

add_hook("AfterModuleSuspend",1,"actionhook_AfterModuleSuspend");

 

 

function actionhook_AfterModuleSuspend($vars) {

$whm_host = $_SERVER['HTTP_HOST'];

$account = $vars["username"];

$result = file_get_contents('http://mywebsite.com/sms.cgi?server=$whm_host&account=$account');

 

}

 

 

?>

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