Results 1 to 6 of 6

Thread: Welcome back or login on main page

  1. #1
    Join Date
    Dec 2007
    Posts
    59

    Default Welcome back or login on main page

    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

  2. #2
    Join Date
    Jun 2007
    Posts
    885

    Default

    Code:
          			<?php
    require("dbconnect.php");
    					require("includes/functions.php");
    					require("init.php");
    					if ($_SESSION['uid']) {
    					}
    
    				?>

  3. #3
    Join Date
    Dec 2007
    Location
    Central Indiana, USA
    Posts
    396

    Default

    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.
    Code:
    <?php
    require("dbconnect.php");
    					require("includes/functions.php");
    					require("init.php");
    					if ($_SESSION['uid']) {
    						echo 'Welcome back!'
    					} else {
    						echo 'Login HTML here'
    					}
    
    				?>
    Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
    LiteSpeed Powered - R1Soft Backups on all accounts! - WHMCS included with Reseller Accounts
    http://www.mddhosting.com/ - Beware “Top 10 Web Hosts” Sites

  4. #4
    Join Date
    Jun 2007
    Posts
    885

    Default

    That should work for what you want:

    Code:
                <?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/>

  5. #5
    Join Date
    Dec 2007
    Location
    Central Indiana, USA
    Posts
    396

    Default

    Looks good, haven't tested it but it should work. I'll definitely save this snippet.
    Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
    LiteSpeed Powered - R1Soft Backups on all accounts! - WHMCS included with Reseller Accounts
    http://www.mddhosting.com/ - Beware “Top 10 Web Hosts” Sites

  6. #6
    Join Date
    Sep 2007
    Location
    Jimboomba, Qld. AU
    Posts
    2,323

    Default

    Try This

    Code:
    {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}
    Last edited by sparky; 08-14-08 at 05:53 PM.

Similar Threads

  1. Whmcs admin sent back to login page
    By Aunhtet in forum Technical Issues and Questions
    Replies: 2
    Last Post: 11-05-12, 11:15 PM
  2. 5.03 to 5.1.2 upgrade when I login it sends me back to login page without error
    By [email protected] in forum Technical Issues and Questions
    Replies: 1
    Last Post: 07-19-12, 01:53 AM
  3. Client cPanel Login button on main client area page
    By jgsketch in forum Customisation and Integration Questions
    Replies: 7
    Last Post: 06-25-11, 02:02 PM
  4. Client Area Title Linking Back To Main Website
    By risoknop in forum Technical Issues and Questions
    Replies: 2
    Last Post: 01-09-10, 07:17 PM
iron-diatonic