hostforweb Posted March 12, 2010 Share Posted March 12, 2010 Hello, Is there a way to get all of the products in the system? this http://wiki.whmcs.com/API:Get_Clients_Products will return all the products for a particular client. However how do i associate , <pid>17</pid> with products in the database ? 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted March 12, 2010 Share Posted March 12, 2010 You can try to resolve this with a custom API. /includes/api/getproductname.php <?php $result = mysql_query("SELECT name FROM tblproducts WHERE id='".$_POST['pid']."' LIMIT 1"); $value = mysql_fetch_array($result); if(mysql_num_rows($result) == 0) echo "result=error;message=Invalid product ID"; else echo "result=success;name=".$value['name']; echo $return; ?> The action-name is getproductname. Just give in the product ID as pid and it returns the name. 0 Quote Link to comment Share on other sites More sharing options...
hostforweb Posted March 12, 2010 Author Share Posted March 12, 2010 Hello, that is great, however, what is the code that authenticates user against the database? or is that taken care of by api.php? 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted March 12, 2010 Share Posted March 12, 2010 Hello, that is great, however, what is the code that authenticates user against the database? or is that taken care of by api.php? Yep, the api.php does that. 0 Quote Link to comment Share on other sites More sharing options...
hostforweb Posted March 12, 2010 Author Share Posted March 12, 2010 Hello, I am seeing an error like this: [Fri Mar 12 16:15:22 2010] [error] System: Connection reset by peer (errno: 104) [Fri Mar 12 16:15:55 2010] [error] mod_ssl: SSL handshake failed (BILLING_URL:443, client aaa.bbb.ccc.ddd) (OpenSSL library error follows) [Fri Mar 12 16:15:55 2010] [error] OpenSSL: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca [Fri Mar 12 16:16:52 2010] [error] mod_ssl: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!] (System error follows) [Fri Mar 12 16:16:52 2010] [error] System: Connection reset by peer (errno: 104) 0 Quote Link to comment Share on other sites More sharing options...
hostforweb Posted March 12, 2010 Author Share Posted March 12, 2010 a quick update where BILLING_URL is https://BILLING_URL i get that error: [Fri Mar 12 16:16:52 2010] [error] mod_ssl: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!] (System error follows) [Fri Mar 12 16:16:52 2010] [error] System: Connection reset by peer (errno: 104) but if i do just http://BILLING_URL API works fine. 0 Quote Link to comment Share on other sites More sharing options...
hostforweb Posted March 12, 2010 Author Share Posted March 12, 2010 Hello, problem solved! http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false) 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.