Integrated Login Form

Discussion in 'aMember Pro v.4' started by crault, Dec 23, 2011.

  1. crault

    crault New Member

    Joined:
    Sep 17, 2011
    Messages:
    10
    Hello everyone,

    Under aMemberPro v3, I am able to integrate an horizontal "login form" which allows users to enter their username and password to login.

    amember_login_form_1.jpg

    If user's name is Jack O'Neill, then once successfully logged in, the "login form" reads: You are now connected as Jack O'Neill.

    amember_login_form_2.jpg

    Is that possible to do the same under aMemberPro v4 and how?

    Thanks very much for your attention,

    Charles
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    You can use this as example:
    PHP:
    <?php if(Am_Lite::getInstance()->isLoggedIn()) {
    print 
    "You are logged in as ".Am_Lite::getInstance()->getName();
    }else { 
    ?>
    Login form html code here.
    <?php ?>
  3. crault

    crault New Member

    Joined:
    Sep 17, 2011
    Messages:
    10
    Thank you Alexander.

    Is your code showing a login/password form even when one is not logged in?

    In the part "Login form html code here."
    • How do I custom the design of the form (size, colour, border, font, etc)?
    • Do you have any example to copy/paste please?
    Cheers,
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    I mean you have to include it yourself.
    Just copy form from login page, and modify it as you need.
    Here is example of the form:
    Code:
                    <form name="login" method="post" action='/amember/login'>
                        <fieldset>
                            <legend>&nbsp;&nbsp;Member Login</legend>
                            <div class="row">
                                <div class="element-title">
                                    <label class="element-title" for="login">E-Mail Address or Username</label>
                                </div>
                                <div class="element">
                                    <input type="text" id="login" name="amember_login" size="15" value="" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="element-title">
                                    <label class="element-title" for="pass">Password</label>
                                </div>
                                <div class="element">
                                    <input type="password" id="pass" name="amember_pass" size="15" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="element" style="vertical-align: baseline">
                                    <input type="submit" value="Login" />
                                    <span style="font-size: large"> or
                                        <a href="javascript: history.back(-1)">Back</a>
                                    </span>
                                </div>
                            </div
                        </fieldset>
                    </form>
    
    
  5. crault

    crault New Member

    Joined:
    Sep 17, 2011
    Messages:
    10
    Thank you Alexander, it works fine now.

Share This Page