Adding Login Form To Main Page

Discussion in 'Customization & add-ons' started by susio1, Aug 11, 2003.

  1. susio1

    susio1 Guest

    Hello, ok i have a question. I have set up my site with the pro version, the index.php page is a custom page i made on my own. I have made a small area within my page with a quick "members login here" area. i copied the same form used in the login.html page (which works fine) into my index page and after entering the correct member info within this new form it fails to verify the info and continue to the members only area like it should. when i use the standard login.php page it works fine. i must be missing some php code for the form to verify the info and continue to member.php. Can you tell me what form code i should use in my php page to have another sign in area?
  2. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    This should be all you need:

    <form action="/amember/login.php" method=post>
    Username: <input type=text name=amember_login size=10><br>
    Password: <input type=password name=amember_pass size=10><br>
    <input type=submit value=Login>
    </form>

    Is that what you are using?
  3. susio1

    susio1 Guest

    thanks working fine, i forgot this part (action="/amember/login.php"). silly me. thanks, nice script guys
  4. Alan

    Alan Guest

    Is there an easy way to add the "Remember my login" with this form?
  5. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Yes, of course!

    PHP:
    <form action="/amember/login.php" method=post>
    Username: <input type=text name=amember_login size=10><br>
    Password: <input type=password name=amember_pass size=10><br>
    <
    input type=checkbox name=remember_login value=1>Remember me
    <input type=submit value=Login>
    </
    form>
  6. thescientist

    thescientist Guest

    here's a question for ya, (i've already submitted a help ticket as well)

    When using firefox browser, i am able to login via the following code on my homepage:

    <form action="/amember/login.php" method=post>
    Username: <input type=text name=amember_login size=10><br>
    Password: <input type=password name=amember_pass size=10><br>
    <input type=checkbox name=remember_login value=1>Remember me
    <input type=submit value=Login>
    </form>

    after entering my info into this form and hitting submit, i am redirected to the proper secured area. however, if i try to access my member page, i am required to re-login.

    i've tested in Internet Explorer and the code works fine. That is, if i login via the form on the main page, i get redirected to a protected area, and then if i click on a link to my member page, i am able to view this page without having to re-login.

    seems to me like this is a problem with the session cookie that is created in firefox. is this true, and what is the solution?

    thanks
  7. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Please have a look if you are using exactly the same URLs. Make the difference between www.yourdomain.com and yourdomain.com
  8. thescientist

    thescientist Guest

    alex, it seems that was what the problem was.

    Thank You
  9. thescientist

    thescientist Guest

    here's what i did to work around the problem of users going to http://mydomain.com instead.


    1) i opened up the /public_html/.htaccess file on my webserver (the .htaccess file in the base of my website)
    2) i added:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mydomain\.com
    RewriteRule ^(.*) http://www.mydomain.com/$1 [R=permanent,L]

    viola! now anytime someone goes to http://mydomain.com they are redirected instantly to http://www.mydomain.com and the login works beautifully.
  10. mstory

    mstory New Member

    Joined:
    Aug 5, 2004
    Messages:
    12
    tried this and it does the trick! thanks!!!!
    :D
  11. david05

    david05 New Member

    Joined:
    Jul 4, 2005
    Messages:
    40
    I have tried the code above for the remember me login feature, but the code doesnt work for me:

    <input type=checkbox name=remember_login value=1>Remember me

    I have a login box on the main page. Do I have to enable something in aMember CP first to get it to remember login details?

    Thanks,

    David
  12. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    It should work if "remember login" feature is enabled at aMember CP -> Setup -> php_include.
  13. dyetube

    dyetube New Member

    Joined:
    Nov 29, 2005
    Messages:
    6
    doesn't seem to work for me

    O.k... I've added the above code to my personalized login screen but when I click login, nothing happens (nor when I hit enter). Any suggestions as to why? I just copied and pasted the code into a cell. thanks
  14. dyetube

    dyetube New Member

    Joined:
    Nov 29, 2005
    Messages:
    6
    nevermind.... fixed it!
  15. eschulze

    eschulze aMember Pro Customer

    Joined:
    Jan 17, 2003
    Messages:
    2
    Remember Me Not Working

    I have used the form above that Alex posted. Everything works fine on the login with one exception.

    The "remember me" feature does not seem to work. When I return to the home page (where the form is) my information is not there.

    Am I missing something?

    Note: it is enabled in the configuration.
  16. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Please have a look:
    http://www.amember.com/forum/showthread.php?t=2819
    It will only work if you frontpage is a PHP page. HTML page is statical, and there is no solution available.
    You will also need to include into top of your page
    require_once('/home/you/public_html/amember/plugins/protect/php_include/reload_if_cookie.inc.php');

    (get/copy file amember/plugins/protect/php_include/reload_if_cookie.inc.php from latest aMember release if it is not exists).
  17. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Please have a look:
    http://www.amember.com/forum/showthread.php?t=2819
    It will only work if you frontpage is a PHP page. HTML page is statical, and there is no solution available.
    You will also need to include into top of your page
    require_once('/home/you/public_html/amember/plugins/protect/php_include/reload_if_cookie.inc.php');

    (get/copy file amember/plugins/protect/php_include/reload_if_cookie.inc.php from latest aMember release if it is not exists).
  18. thegraph

    thegraph New Member

    Joined:
    Aug 29, 2006
    Messages:
    5
    This works perfect. Thanks!

Share This Page