Jump to content

Welcome back or login on main page


plazmahost

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

Link to comment
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'
				}

			?>

Link to comment
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/>

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