View Full Version : Adding Login Form To Main Page
susio1
08-10-2003, 10:00 PM
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?
abbeyvet
08-11-2003, 08:55 AM
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?
susio1
08-11-2003, 02:18 PM
thanks working fine, i forgot this part (action="/amember/login.php"). silly me. thanks, nice script guys
Is there an easy way to add the "Remember my login" with this form?
Yes, of course!
<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>
thescientist
01-17-2005, 05:01 PM
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
Please have a look if you are using exactly the same URLs. Make the difference between www.yourdomain.com and yourdomain.com
thescientist
01-18-2005, 07:18 PM
alex, it seems that was what the problem was.
Thank You
thescientist
01-18-2005, 07:30 PM
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.
mstory
01-19-2005, 12:08 AM
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.
tried this and it does the trick! thanks!!!!
:D
david05
10-31-2005, 05:50 AM
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
It should work if "remember login" feature is enabled at aMember CP -> Setup -> php_include.
dyetube
11-30-2005, 02:40 PM
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
dyetube
11-30-2005, 02:42 PM
nevermind.... fixed it!
eschulze
08-15-2006, 12:55 AM
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.
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).
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).
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.