dzhorov Posted May 9, 2010 Share Posted May 9, 2010 Hey guys, I have started a new website written in html and a little bit of PHP and I have decided that I'll go for WHMCS as billing system. I have almost completed the integration with the the WHMCS and my main website, however there is one little thing that bugs me quite a bit. I have a login form on the main website index.php(not the WHMCS) that looks like this: <div align="left"><form method="post" action="http:/mysite.com/accounts/dologin.php?goto=clientarea"> <input type="hidden" name="token" value="ee3109870cd9a8da0813754ad123397552561563" /> Client login: <br /><input type="text" name="username" size="10" value="Username"> <input type="password" name="password" size="10" value="******"> <input type="submit" value="Login"> </form></div> e.g. the usual HTML login form which works perfectly with the WHMCS and correctly logs me to the client account. I have then implemented a IF statement im my header.tpl file of the template that looks like this: {if $loggedin} Welcome, {$clientsdetails.firstname} <td><a href="logout.php">{$LANG.logouttitle}</a></td> {else} which also works perfectly and shows in WHMCS the first name of the client that has logged in. However, here my problem: When i go back to my main website page(not whmcs) it doesn't show that this client has logged in. My question is how should I go for implementing something like the above IF statement in the header.tpl on my main index.php file. I'll really appreciate if someone has already solved that problem and shares that information 0 Quote Link to comment Share on other sites More sharing options...
robb3369 Posted May 10, 2010 Share Posted May 10, 2010 Take a look at how to create pages: http://wiki.whmcs.com/Creating_Pages You will need access to a few items from WHMCS to use the user functionality outside of the system... 0 Quote Link to comment Share on other sites More sharing options...
dzhorov Posted May 10, 2010 Author Share Posted May 10, 2010 You have no idea how much that hint helped me Rob ! Thank you ! After hours of banging my head on how to implement the login feature and show that a user is logged in no matter where on the website he is, I finally solved that problem. Placing your WHMCS in the root folder and building your website around it is the solution. Creating a custom page for the main index did the trick for me. P.S. Don't forget placing the {literate}{/literate} tags around every <script></script> and <style></style> tags that you place in your custom .tpl file ! 0 Quote Link to comment Share on other sites More sharing options...
dzhorov Posted May 10, 2010 Author Share Posted May 10, 2010 You have no idea how much that helped me Rob ! Thank you ! Placing the WHMCS in the root folder and building your website around it solved my problem. You will need to create a custom index and corresponding .tpl for that file as the tutorial suggest. 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.