Results 1 to 5 of 5

Thread: If not logged in redirect to register page

  1. #1
    Join Date
    Apr 2007
    Posts
    25

    Default If not logged in redirect to register page

    I want users to register before they can see the order/cart process.

    Something like this?

    {if !$loggedin}
    redirect => register.php
    {else}
    rest of code..
    {/if}

    Thanks

  2. #2
    Join Date
    Apr 2007
    Posts
    25

    Default

    Resolved:

    {if !$loggedin}
    {php}
    header('Location: /register.php');
    {/php}
    {/if}

  3. #3
    Join Date
    Jul 2009
    Posts
    30

    Default

    Ey! that's interesting - I'm looking for something that would make the client area restricted to only members.
    This code seems fine, but I am not sure where I should put it. Can someone advice?
    Thank you

  4. #4
    Join Date
    Jun 2009
    Location
    UK
    Posts
    6,331

    Default

    I'd hazard a guess and put :
    {if !$loggedin} in header.tpl
    and
    {/if} in footer.tpl
    WHMCompleteSolution
    The Complete Client Management, Billing & Support System
    www.whmcs.com

  5. #5
    Join Date
    Mar 2012
    Posts
    3

    Default Re: If not logged in redirect to register page

    Quote Originally Posted by muchos View Post
    Resolved:

    {if !$loggedin}
    {php}
    header('Location: /register.php');
    {/php}
    {/if}
    Hi

    I have tried placing the above code inside cart.php to prevent none logged in users from accessing cart.php but i have got an error
    Also i have tried to place it inside the header but nothing happened!

    I have alos tried :

    if ($_SESSION['uid']) {
    # User is Logged In - put any code you like here
    }else{
    $goto="login";
    include("login.php");

    }

    ?>


    And:


    {if !$loggedin}
    {php}
    header('Location: https://mywebsite.com /register.php');
    {/php}


    Also no luck!

    Any suggestions please?

    WHMCS V5.2

Similar Threads

  1. Replies: 1
    Last Post: 07-25-12, 09:35 PM
  2. How to Pass set of keywords from external page to domain bulk register page
    By jainritesh in forum Customisation & Integration Questions
    Replies: 0
    Last Post: 03-08-11, 11:55 AM
  3. Redirect from contact page for logged in customers?
    By Si in forum Customisation & Integration Questions
    Replies: 3
    Last Post: 02-18-11, 10:19 AM
  4. Invoice page that was redirect from final order page...
    By johnh in forum Feature Requests
    Replies: 1
    Last Post: 03-11-07, 05:44 PM