bhavicp Posted November 3, 2009 Share Posted November 3, 2009 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"]; 0 Quote Link to comment Share on other sites More sharing options...
bhavicp Posted November 3, 2009 Author Share Posted November 3, 2009 If someone who's made their own module can let me know how they connect to another API that would be great. Just the function or a few lines of code would be REALLY awesome! 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.