Jump to content
plazmahost

Welcome back or login on main page

Recommended Posts

Hello - Ive been looking all day on the forums and cannot find a clear answer for this

 

can someone tell m if there is a workin script or someone know exaclt how ot do this

 

Basically on my homepage i want to be able to put a script that will read the sessions on whmcs and see if users are logged in, if they are u want it to show welcome back Mr Doe or if they arent then a link to say Login to Client Area

 

If no one has it any snippets or help would be appreciated greatly

 

thanks

 

Daniel

Share this post


Link to post
Share on other sites
     			<?php
require("dbconnect.php");
				require("includes/functions.php");
				require("init.php");
				if ($_SESSION['uid']) {
				}

			?>

Share this post


Link to post
Share on other sites

I assume that you would want to do something like this (modified the above code)?

 

I could be wrong, but I think this is the end goal. You'd have to write some more to get the customer name but this is a start in the right direction.

<?php
require("dbconnect.php");
				require("includes/functions.php");
				require("init.php");
				if ($_SESSION['uid']) {
					echo 'Welcome back!'
				} else {
					echo 'Login HTML here'
				}

			?>

Share this post


Link to post
Share on other sites

That should work for what you want:

 


           <?php
         require("dbconnect.php");
         require("includes/functions.php");
         require("init.php");
         if ($_SESSION['uid']) {
         echo("<strong>Welcome Back</strong><br>");
         echo "<strong>{$clientsdetails[firstname]}</strong>" ;
         echo " ";
         echo "<strong>{$clientsdetails[lastname]}</strong><br><br>" ;
         }
       else {
       echo "{ Put what you want to show when not logged in here!}</strong><br><br>" ;
				}
       ?>
   <br/>

Share this post


Link to post
Share on other sites

Try This

 

{if $loggedin}
Welcome back Mr Doe - <a style="background-image:none;" href="logout.php">{$LANG.logouttitle}</a>
{else}
<a style="background:none;" href="login.php">{$LANG.clientareatitle}</a>
{/if}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines