login redirect?

Discussion in 'Customization & add-ons' started by squidjomom, May 26, 2004.

  1. squidjomom

    squidjomom Guest

    How can I change the page users are redirected to after logging in? I don't want to replace the member.htm page because I need it if they want to buy additional classes. I just want it to go to another page that I designed.

    Where do I find this?
  2. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    amember/templates/thanks.html
    replace "member.php" link to any link you want.
  3. dbpettit

    dbpettit New Member

    Joined:
    Jan 11, 2007
    Messages:
    2
    It's obviously been a few years since this subject has been touched upon... but it's something I need now and I can't find the member.php link in thanks.html. I'm guessing in the subsequent three years the location of this has moved to another file...

    Thanks in advance for your help!
  4. joe_asto2

    joe_asto2 New Member

    Joined:
    Aug 22, 2006
    Messages:
    68
    Things have changed quite a lot!

    The code you're looking for is on the last line of login.php

    Here's the context:
    PHP:
    if ($_SESSION['amember_redirect_url']) {
            
    $redirect $_SESSION['amember_redirect_url'];
            unset(
    $_SESSION['amember_redirect_url']);
    } elseif (
    count(array_unique($urls)) == 1){
        if (
    in_array('htpasswd_secure'$plugins['protect'])){
            
    $member_login_pw 
            
    htpasswd_secure_get_login($_SESSION['_amember_user']['login']).
            
    ':'.
            
    htpasswd_secure_get_passwd($_SESSION['_amember_user']['pass']);
            
    $redirect add_password_to_url($urls[0], $member_login_pw);
        } else {
            if (
    $config['display_member_pw_urls']) {
                 
    $member_login_pw 
                 
    $_SESSION['_amember_user']['login'].
                 
    ':'.
                 
    $_SESSION['_amember_user']['pass'];
                 
    $redirect add_password_to_url($urls[0], $member_login_pw);
            } else {
                
    $redirect add_password_to_url($urls[0]);
            }
        }
    } else {
        
    $redirect "http://www.example.com/amember/member.php";
    }
    #print_r($urls);
    html_redirect("$redirect"0'Redirect'_LOGIN_REDIRECT);
    You can replace $redirect with anything you want, or you change the $redirect variable's value 3 lines above.

    You can even replace the html_redirect with a header location redirect, but this doesn't seem to be as efficient:

    PHP:
    header("Location: http://www.example.com/");

    Anything is possible in aMember. I'll probably be posting up my site soon.

    Hope this helps!
  5. firstaidweb

    firstaidweb New Member

    Joined:
    Feb 22, 2007
    Messages:
    1
    how can i make this:

    $redirect = "http://www.example.com/amember/member.php";

    specific to product?.. in other words,

    {if product_id == 1}

    $redirect = $config['root_url'] . "/product1.php";

    } else {

    {if product_id == 2}

    $redirect = $config['root_url'] . "product2.php";

    etc?..

    do i need to say $payment.product_id or $p.product_id or what?.. any suggestions?

    thank you!
  6. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Customer can have several subscriptions - which one would you like to use?

    In your case you don't need ANY programming!
    Go to aMember CP -> Manage Products, click Edit and set Product URL:
    Product#1 : /amember/product1.php
    Product#2 : /amember/product2.php
    and so on.
    Then if customer have ONLY ONE ACTIVE subscription, he will be automatically redirected to product url right from login.php page
    In other case, he will be redirected to member.php to choose an URL to go,
    or to renew subscription if necessary.
  7. kilerb

    kilerb New Member

    Joined:
    Apr 16, 2007
    Messages:
    20
    Where do you change the text "You are being redirected to a secure area" after you login? I'd like to make that say something else. I looked on the login.php page and did not see it there. Thanks!
  8. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    In the language files. I say this without giving much thoughts intuitively.

    In principle, all the text generated are in the lang-en.php.
  9. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Of course, it is inside amember/languages/en.php
  10. combatraph

    combatraph New Member

    Joined:
    Mar 4, 2007
    Messages:
    6
    Hi,
    I have tried to do the above for my products but continue to get the member.php page when i login, i need to have the redirection to point to the index page not the members page after login.

    In future i will have a product group that will allow access to multiple products at this stage iwont mind it going to the member.php page so the customer can choose.

    But for single products it must re-direct to the index.php page in protected folder.

    How do i do this and why is it not working, is this a fault with the amember CP?

    Regards,
  11. GoldRoo

    GoldRoo New Member

    Joined:
    May 18, 2005
    Messages:
    39
    I think there might be a bit of a misunderstanding here:
    1. some people are talking about what page should show after logging in when you are already a member, and
    2. other people are talking about what page should show when you just have joined.

    This is a solution to the first problem.

    When creating a link to login, send your members to www.example.com/protected-folder-homepage, do not send them to www.example.com/amember/login.php.
    aMember will automatically send your members to the login page if they are not logged in yet, and as soon they login they will be redirected to the protected-folder-homepage.
    We actually link to a number of aMember protected pages from our public site, and depending whether members are logged in or not, they go straight to the URL we want them to go, or they go through login.php before automatically being redirected to the URL we want them to go.
    (Hope I explained myself well)
  12. combatraph

    combatraph New Member

    Joined:
    Mar 4, 2007
    Messages:
    6
    Yes, i understand the scenario you have just painted.

    What i need is for when a member logs in i need the login script to direct them to the index page in the secured folder and no the member.php location which shows the subscription they have and then they click the link to go to the index page in the secured area.

    So for example when i login i want amember to direct me directly to the index page where i can see the products. At this stage it just directs me to the page where i can see my subscription and have to click the link '1 month subscription' to get to the index page.

    How do i do the above, my members are already complaining that they have to click the link to get to the index page and some are just getting plain confused because they dont know they have to click the link to get to the index page.

    This is now starting to turn in to a issue for me.

    Someone please help if you know the fix for this.

    Regards,
  13. combatraph

    combatraph New Member

    Joined:
    Mar 4, 2007
    Messages:
    6
    So how do i actually do this?
    I think you hit the nail on the head!
  14. GoldRoo

    GoldRoo New Member

    Joined:
    May 18, 2005
    Messages:
    39
    Well, like I said: instead of creating a link to the login page everywhere on your site, you create a link to your protected page.

    Have a look on our site: everywhere you will find a "Partner login" link on http://wizz.to , and the link goes to our protected pages, not to the login page.

    Try this link: http://wizz.to/partner/main/ and you will see what I mean.
    If you would be logged in already, you would go straight to the protected page, however when you're not logged in it will redirect to the login page.

    Have a look at this page: http://wizz.to/join/newsletters/June-2007/
    You will see that we just link to all different protected pages from a non-protected page and depending on whether you're logged in or not, you will go straight there or not.

    Hope that is clearer.
  15. combatraph

    combatraph New Member

    Joined:
    Mar 4, 2007
    Messages:
    6
    Thank you for your help, i have figured this out now and have made the links in index.html template point to login.php which does automatically redirect to the protected area.

    Regards.

Share This Page