plazmahost Posted August 10, 2008 Share Posted August 10, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted August 11, 2008 Share Posted August 11, 2008 <?php require("dbconnect.php"); require("includes/functions.php"); require("init.php"); if ($_SESSION['uid']) { } ?> 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted August 13, 2008 Share Posted August 13, 2008 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' } ?> 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted August 13, 2008 Share Posted August 13, 2008 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/> 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted August 13, 2008 Share Posted August 13, 2008 Looks good, haven't tested it but it should work. I'll definitely save this snippet. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 14, 2008 Share Posted August 14, 2008 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} 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.