login redirect from an inline frame

Discussion in 'Templates customization' started by sdstren, Sep 15, 2009.

  1. sdstren

    sdstren New Member

    Joined:
    Nov 30, 2007
    Messages:
    14
    I have a login button on every page in my site. The code for my button is:

    =====================================================
    <script type="text/javascript">
    function show_login_box()
    {
    var r=confirm("Access Denied..." + '\n' + "You must be logged in and a member to access this resource." + '\n' + "Click 'OK' to LOGIN or 'Cancel' to close this window.");
    if (r==true)
    { window.location.assign("http://www.livinglearningbooks.com/login.htm"); }
    else
    { window.focus();
    }
    }
    function show_nomembership_box()
    { alert("Your current membership level does not include this unit."); }
    </script>

    <p style='font-family:verdana,tahoma; font-size:8.5pt; color:#CC0000; text-align: center'>You are not logged in.<br><a href='/login.htm'>LOGIN NOW</a><br>
    =======================================

    When the user clicks on this button, it sends them to the login.htm page, which itself also has the above login button on it. In addition, login.htm has an inline frame. The code for the inline frame is as follows:

    =============================
    <iframe name="curr" src="/amember/login.php" width="634px" height="612px" frameborder="0">
    Your browser does not support inline frames or is currently configured not to display inline frames.
    </iframe>
    =============================

    My problem is this: when the user logs in, the redirect in amember causes the members page to load in the iframe. No biggy except that my login button on all of the pages that is NOT in the iframe, never gets updated to say that the user is logged in. How can I get the two to talk to each other?

    You can see this page at www.livinglearningbooks.com/login.htm.

    Help!
  2. kengary

    kengary aMember Pro Customer

    Joined:
    Nov 13, 2008
    Messages:
    231
    What if you put some Javascript code on the page to reload the iframe after page load one time or on some other action?

Share This Page