devron6 Posted February 15, 2011 Share Posted February 15, 2011 Hello, I am trying API for the first time and have entered the following code into my dedicated server page. At this point i get nothing but errors. I am running Whmcs 4.4.1 anyone that could lend advise please Heres the code in return i get <?php $url = "http://portal.critical.net/include/api.php"; # URL to WHMCS API file $postfields["action"] = "getproducts"; $postfields["gid"] = "12"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } ?> Notice: Undefined offset: 1 in /home/critical/critical.net/public_html/managed_dedicated.php on line 138 Notice: Undefined index: result in /home/critical/critical.net/public_html/managed_dedicated.php on line 141 Notice: Undefined index: message in /home/critical/critical.net/public_html/managed_dedicated.php on line 145 The following error occured: 0 Quote Link to comment Share on other sites More sharing options...
devron6 Posted February 15, 2011 Author Share Posted February 15, 2011 Hello, I got it to work however now i am just simply getting text with no working links. Does anyone have any idea why this is happening you can view the page at http://critical.net/managed_dedicated.php 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.