Eliav Posted September 2, 2007 Share Posted September 2, 2007 Hi there, I am looking for a way to get some of the client data in a custom page for my WHMCS install. I currently want a list of all hosting accounts that are a specific type (like id=22 or something). The best thing would be getting the usernames of the client's hosting packages- in an array or something else. I can easily do this in my own mysql query, but I wasn't sure if it did it already, and I also need to get some client data to use for the WHERE section of the mysql query. If I am making no sense at all, let me know and I will try to explain it in another way. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Eliav Posted September 2, 2007 Author Share Posted September 2, 2007 Okay, I figured out how to do what I wanted. Let me know if there is an easier way, but I just used: $id = $clientsdetails['id']; $q1 = mysql_query("SELECT username FROM tblhosting WHERE userid = '$id' "); $r1 = mysql_fetch_array( $q1 ); $username = $r1['username']; That gives me the username of the hosting account of the current user that is logged in. For those who need other variables, you can just change the SELECT statement to what you need or use *. 0 Quote Link to comment Share on other sites More sharing options...
Eliav Posted September 2, 2007 Author Share Posted September 2, 2007 Okay, another problem. I need a way to decrypt the server password located in the mysql database (I am adding some server functions that are not yet implemented in WHMCS). I am not sure what API method you use for the servers, so I just used the PHP one on Direct Admin. If you are using the same one, that would make things easier (just let me know how to use your current config). If not, then is there a way I can decrypt my server password to login to the server from my own file? I have everything else worked out the way I need it to, but I just need to get the passwords working (so I dont have to store server passwords in a file and so I dont have to manually edit the file everytime I add a new server). Thanks! 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.