weblantis Posted October 13, 2010 Share Posted October 13, 2010 See this link: If you want to display one of the following login status messages on any PHP page outside of the whmcs folder: Please Login or Register (if user has not logged in) Welcome Back {first name} | My Details | Logout (displayed to logged in users) My solution is a PHP solution, and here it is: Create file called login_status.php and save it in the WHMCS folder. Then copy & paste the following code to this file: <?php require("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'>".$_LANG['welcomeback'].', '.$row['firstname'].' | <a href="/whmcs/clientarea.php"><strong>'.$_LANG['clientareanavdetails'].'</strong></a> | <a href="/whmcs/logout.php"><strong>'.$_LANG['logouttitle'].'</strong></a></p>'; } else{ echo "<p id='login'>".$_LANG['please'].' <a href="/whmcs/clientarea.php" title="Login"><bold>'.$_LANG['loginbutton'].'</bold></a> '.$_LANG['or'].' <a href="/whmcs/register.php" title="Register"><bold>'.$_LANG['clientregistertitle'].'</bold></a></p>'; } ?> (You will notice that I included some css tags and html bold tags for styling purposes.) Now include the following line of code on any php based web pages located outside of the whmcs folder: <?php include('pathto/whmcs/login_status.php'); ?> That is it! You don't need this solution if your entire website is built on whmcs. However, in my case, whmcs is only one part of my website. the others parts of my website are my own custom web pages and a Wordpress installation. So by using this approach I can keep all my files organised and in separate folders. 0 Quote Link to comment Share on other sites More sharing options...
gamemaniacs Posted November 20, 2011 Share Posted November 20, 2011 Hey! This worked perfectly for me! However, I want to modify the dologin.php a bit. I mean what I want is that once I enter my login details, I should be redirected to the same page from where I clicked the Login option. How do I do it? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted November 22, 2011 Share Posted November 22, 2011 Just a note, if you host WHMCS on a different subdomain than your website, this likely will not work. 0 Quote Link to comment Share on other sites More sharing options...
born13 Posted November 18, 2012 Share Posted November 18, 2012 i got the following messages after i include the codes on my wordpress site php pages: any help???????????? thanks Down for Maintenance An upgrade is currently in progress... Please come back soon... 0 Quote Link to comment Share on other sites More sharing options...
mukoshy Posted December 18, 2012 Share Posted December 18, 2012 i got the following messages after i include the codes on my wordpress site php pages: any help???????????? thanks Down for Maintenance An upgrade is currently in progress... Please come back soon... This means that your WHMCS is in maintenance mode, you can change that from your General Settings. 0 Quote Link to comment Share on other sites More sharing options...
sufi Posted January 2, 2013 Share Posted January 2, 2013 Nope, I also get this same error message if I call dbconnect.php from outside whmcs folder Any solution?? This means that your WHMCS is in maintenance mode, you can change that from your General Settings. 0 Quote Link to comment Share on other sites More sharing options...
SteveV Posted January 11, 2013 Share Posted January 11, 2013 I'm also seeing the maintenance message when calling dbconnect.php from outside the whmcs folder. Any solution? 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.