Jump to content

Display WHMCS data elsewhere


QuidWeb

Recommended Posts

Hi,

In short WHMCS is my backend system only. I have a wordpress front end modified using iframes to display specific client information.

I wonder if it is possible to display WHMCS data without frames? The wordpress & WHMCS installation is on the same server

 

root/(Wordpress)

root/whmcs

 

i suppose in my ind im thinking of a way to connect my pages to the wordpress database somehow so i can show things like {$clientsdetails.firstname} {$clientsdetails.lastname} etc on any page?

 

thanks

Link to comment
Share on other sites

Here's something I use to allow login and "welcome back user" on my main site pages (slightly older version of WHMCS). Change the obvious (including adding "lastname" to the query and display lines), save this file to your WHMCS root directory, and use PHP to include it on whatever page it should be on. Your results may vary. :)

 

<?php

include("dbconnect.php"); 

if ($_SESSION['uid']) {

$result = mysql_query("SELECT firstname FROM tblclients WHERE id='".$_SESSION['uid']."' LIMIT 1;");

   while($row = mysql_fetch_array($result))

       echo "<p id='login'><span class='loginwelcome'>".$_LANG['welcomeback'].', '.$row['firstname'].': | <a href="https://www.DOMAIN.com/WHMCS/clientarea.php">'.$_LANG['clientareatitle'].'</a> | <a href="https://www.DOMAIN.com/WHMCS/logout.php">'.$_LANG['logouttitle'].'</a></span></p>';

}

else{

   echo '<form action="https://www.DOMAIN.com/WHMCS/dologin.php" method="post" name="form" class="header">Client Login: 

         <input name="username" type="text" class="login" id="username" value="username" size="15"">

         <input name="password" type="password" id="password" value="xxxxx" size="15"">

         <input type="hidden" name="token" value="YOURTOKENVALUE" />

         <input type="image" src="/images/go.gif" width="25" height="19" align="absmiddle">

       </form>';

}

?>

Link to comment
Share on other sites

I would like to know how to implement this into a WordPress menu, but I keep running into errors.

 

Ideally the menu would work like this:

 

If $loggedin

 

Client name

Some other links

Logout

 

Else

 

Login

Register

 

WHMCS doesn't even do this on their front-end WordPress install though????? For the record, the error I got was within WordPress, my PHP include had to be hard coded, and still wouldn't work right.

Edited by MemoryX2
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