Login Code

Discussion in 'aMember Pro v.4' started by darren, Oct 19, 2011.

  1. darren

    darren Member

    Joined:
    Aug 22, 2006
    Messages:
    36
    Does anyone know what code is needed from V4 to have a login page outside of Amember like we can with V3?
  2. darren

    darren Member

    Joined:
    Aug 22, 2006
    Messages:
    36
    I'm not 100% sure this will work for everyone, but it worked for me.

    Code:
                <form name="loginform" id="loginform" action="http://www.yoursite.com/amember/login" method="POST">
                    <p><label><?php print $instance['username_title'];?></label><br/>
                        <input type="text" name="amember_login" class="input" id="user_login" size="15"></p>
                    <p><label><?php print $instance['password_title'];?></label><br/>
                    <input type="password" name="amember_pass" id="user_password" class="input" size="15"></p>
                    <input type="hidden" name="amember_redirect_url" value="http://www.yoursite.com/whereyouwantyourusertogoafterloggingin/">
                    <p class="submit">
                        <input type="submit" name="wp-submit" id="wp-submit" value="Login">
                    </p>
            </form>
    
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Thanks for the follow up!
  4. jbildy

    jbildy Member

    Joined:
    Aug 22, 2006
    Messages:
    97
    That works... but there is no label for 'username' and 'password'. Just the empty fields to enter them.

    How would I add the labels?

    Attached Files:

  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    If your page is php you can use this to display aMember's login form:
    PHP:
    include "/full/path/to/amember/library/Am/Lite.php";
    echo  
    Am_Lite::getInstance()->renderLoginForm();
  6. jbildy

    jbildy Member

    Joined:
    Aug 22, 2006
    Messages:
    97
    My page is Wordpress.

    I don't want to use the login widget. So I have created a login link that goes to aMember login page.

    So not to worry just now.
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    John,
    I have a question if you don't mind. I see that you use wordpress, why you don't want to use amember login widget?
    Is there any islsue with it?
  8. jbildy

    jbildy Member

    Joined:
    Aug 22, 2006
    Messages:
    97
    Takes up space in sidebar.

    I have a login link in a wp menu in the header top-right of my site.
  9. wallpaper_01

    wallpaper_01 Member

    Joined:
    Mar 9, 2011
    Messages:
    116
    Hi how does this work?

    PHP:
    <?php
     
    include "/amember/library/Am/Lite.php";
    echo  
    AmLite::getInstance()->renderLoginForm();
     
    ?>
    Im just getting

    Fatal error: Class 'AmLite' not found in C:\xampp\htdocs\login.php on line 4
  10. alex

    alex Well-Known Member Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    sorry, replace AmLite to Am_Lite and it will work.
  11. wallpaper_01

    wallpaper_01 Member

    Joined:
    Mar 9, 2011
    Messages:
    116
    Ah ok yeah that works, do I need to do anything else? At the moment im getting HTTP/1.1 404 Not Found

    But I noticed that my address is localhost//amember/login/index

    Im using jumi for joomla. I set my directory to include "../amember/library/Am/Lite.php";
  12. wallpaper_01

    wallpaper_01 Member

    Joined:
    Mar 9, 2011
    Messages:
    116
    Ignore previous post! fixed!
  13. wallpaper_01

    wallpaper_01 Member

    Joined:
    Mar 9, 2011
    Messages:
    116
    Also actually is it easy enough to have your whole member area in the same way as the login? So I can have it all in Joomla?
  14. josephsharme

    josephsharme New Member

    Joined:
    Dec 23, 2020
    Messages:
    1
    Suppose I want to install my amember in website website1.com/auth/ and I also want to make a amember login page on my website xyz.website2.com/login.
    So, how can I validate a user based on a product from my website1

Share This Page