Redirect when logged in

Discussion in 'Templates customization' started by Compu, Jul 26, 2004.

  1. Compu

    Compu Guest

    Question:

    Is there anyway that I can insert php code into my html home page that redirect the users to the members page when they are logged in?

    Example:

    Someone uses the "Remember Me" feature of the login, when they leave and then revisit the home page it will take them to their member page.

    Is this possible?

    Thanks!
    Jon
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    there is nothing impossible, add the following php code to top of PHP page:

    PHP:
    <?php
    session_start
    ();
    if (
    $_COOKIE['_amember_ru'] && !$_SESSION['_amember_redirected']){
      
    $_SESSION['_amember_redirected'] = 1;
      
    header("Location: /amember/member.php");
      exit();
    }
    ?>

Share This Page