Jump to content

Implementing login form


Recommended Posts

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 :)

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

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.

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