QuidWeb Posted April 22, 2013 Share Posted April 22, 2013 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 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 23, 2013 Share Posted April 23, 2013 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>'; } ?> 0 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted April 24, 2013 Share Posted April 24, 2013 (edited) 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 April 24, 2013 by MemoryX2 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 24, 2013 Share Posted April 24, 2013 the error I got was within WordPress, my PHP include had to be hard coded, and still wouldn't work right. Mentioning the specific error and what you mean by "wouldn't work right" would be helpful. Hints here that might help get that running: http://wordpress.stackexchange.com/questions/34287/warning-when-using-php-include-thefile-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.