Jump to content

Module Help


bhavicp

Recommended Posts

I didn't know where exactly to post this, So i'm posting it here.

 

I've been trying to create a simple module which will create accounts when the button is pressed in WHMCS,

 

I've got the basic's sorted out. But Im having trouble connecting to the API.

 

function stormbasic_CreateAccount($params) {

# Code to perform action goes here...
$successful = file_get_contents("http://domain.com/file.php?username=".$user."&pass=".$password."&actions=create");

   if ($successful) {
	$result = "success";
} else {
	$result = "Error Message Goes Here...";
}
return $result;
}

 

I've got something like this currently, but when the module runs. It doesn't do $file_get_contents. I have no idea why. If you manually go to the API with the params (i've echoed these) it works perfectly. But the module just doesn't call the API.

 

Any help would be much appreciated, as i had a really good look but there isn't much documentation (or forum posts) on creating modules!

 

Also, Is there a way to get $serverhostname like:

 

$serverid = $params["serverid"];
   $serverip = $params["serverip"];

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