Amember Redirect - Slightly different prob i think?

Discussion in 'Integration' started by brenton, Oct 21, 2009.

  1. brenton

    brenton New Member

    Joined:
    Oct 21, 2009
    Messages:
    1
    Hello

    I am using Hidepost plugin in Wordpress with Amember.


    When a member clicks the "login to view content link" it takes them to the amember login form.

    The problem is it will redirect them to the "product url" when they log in. But I want it to redirect them to the original page they were on.


    I have tried all the remcommended options posted on this site and i cant get it to work.

    ------------------------------------------------------------------
    I have tried placing the following code into the amember login.html -

    <input type=\"hidden\" name=\"amember_redirect_url\" value=\"http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\">

    also tried:

    <input type="hidden" name="amember_redirect_url" value="/redirect_url/>"/>

    also tried:

    <script type="text/javascript" language="JavaScript"><!--
    document.write('<input ');
    document.write(' type="hidden" ');
    document.write(' name="amember_redirect_url" ');
    document.write(' value="' + document.URL + '">');
    //--></script>

    But it still does not redirect them - it seems to either default to product url or just go to "www.mysite.net/redirect_url/ - page not found"

    I have also tried removing -

    {if $redirect_url}
    <input type="hidden" name="amember_redirect_url" value="{$redirect_url|escape}" />
    {/if}

    but still does not work??

    What am i missing as it does say in the address bar of the login.html page:
    "http://www.mysite.net/members/login.php?redirect_to=/member-only-section.html"


    Thankyou for you help
    Brenton
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    What code you used to redirect user to aMember's login page?
  3. cricketcoach

    cricketcoach New Member

    Joined:
    Mar 4, 2008
    Messages:
    2
    I am having the same problem.
    I changed
    "http://www.mysite.net/members/login.php?redirect_to=/member-only-section.html"
    to
    "http://www.mysite.net/members/login.php?redirect_url=/member-only-section.html"

    in hidepost.php.
    It is still not redirecting for me after making this change.

    This is the code in my login.html:
    {if $redirect_url}
    <input type="hidden" name="amember_redirect_url" value="{$redirect_url|escape}" />
    {/if}

    Any help is greatly appreciated :)
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Try to change url to
    Code:
    http://www.mysite.net/members/login.php?amember_redirect_url=/member-only-section.html
  5. cricketcoach

    cricketcoach New Member

    Joined:
    Mar 4, 2008
    Messages:
    2
    Perfect works like a charm!
    Thanks for you fast response :)

Share This Page