Hi All,
I want to add login system for my website. It is a website for my wedding and would prefer the info is just for the invited guests. I know basic HTML but unfortunately that is about it- I'm a pretty quick learner though.
Could someone pretty please give me a basic step by step guide to doing this, or at least some hints on what scripting language or whatever this will require. I don't mind if everyone just logs in as "visitor" or something with a generic password- the wedding is in a small town in the Australian outback so crashers isn't reallly an issue, but a little security would be nice. Any help you can give will be appreciated.
-Kath
I think you can use the PHP Scripting Language to retrieve passwords and usernames of your members to a database...
| Kath wrote: |
I want to add login system for my website. It is a website for my wedding and would prefer the info is just for the invited guests. I know basic HTML but unfortunately that is about it- I'm a pretty quick learner though.
Could someone pretty please give me a basic step by step guide to doing this, or at least some hints on what scripting language or whatever this will require. I don't mind if everyone just logs in as "visitor" or something with a generic password- the wedding is in a small town in the Australian outback so crashers isn't reallly an issue, but a little security would be nice. Any help you can give will be appreciated. |
Hi Kath, I think you don't need a complex login system.
Something based on Apache's .htaccess might be enough for you ...
I made a page protected with it. There are two users with access; guest and john (passwords are guest and password respectively).
The test directory has three files:
index.html is the file with HTML which you already know how to do;
.htaccess and .htpasswd specify who can see the index.html.
My test page is here: http://www.hexkid.frih.net/test_ht/index.html
It shows the contents of .htaccess and .htpasswd
I used http://spectrum.troy.edu/password/ to generate the passwords for the .htpasswd file.
Last edited by hexkid on Sun Nov 26, 2006 5:29 pm; edited 1 time in total
OR if you have cpanel you can do it in there using the password directories
Thanks for your help guys! esp hexkid.
I am still struggling alittle.
I have made two files;
"LOGIN.htaccess"
This contains:
"require valid-user
AuthType Basic
AuthName Liam and Kath
AuthUserFile E:\Other\Wed\Webpage\Wedpage\LOGIN.htpasswd"
"LOGIN.htpasswd"
This contains: (i used the Troy encrypted password thing- very cool!)
"Kath:ewIwV32Y.TVvM
guest:eqLX5l2QKYIXM"
What do I need to put into my webpage index.html file so that when I try to open it it will make me login?
Is the stuff that I have in the above files right?
Sorry to be so amatuer but this is the first website I have ever made, I don't know what php and cpanal are!
-Kath
| Kath wrote: |
I am still struggling alittle.
I have made two files;
"LOGIN.htaccess" and "LOGIN.htpasswd"
What do I need to put into my webpage index.html file so that when I try to open it it will make me login?
Is the stuff that I have in the above files right? |
Unless you changed your httpd.conf file (the Apache configuration) the files *must* be called .htaccess and .htpasswd (maybe .htpasswd can be different).
I think you may have a few problems creating these files in Windows, so maybe a zipped version works. Download from http://www.hexkid.frih.net/test_ht/WedPage.zip and extract to E:\Other\Wed\Webpage\Wedpage\
I copied the info you posted to the zipped .ht* files, so it probably works right out of the .zip. You only have to change index.html and create other .html files.
When you have the two files in place
E:\Other\Wed\Webpage\Wedpage\.htpasswd
E:\Other\Wed\Webpage\Wedpage\.htpasswd
any other file in that directory will require a login (only for the first visit, or after closing the browser, or rebooting)
E:\Other\Wed\Webpage\Wedpage\index.html
E:\Other\Wed\Webpage\Wedpage\index2.html
E:\Other\Wed\Webpage\Wedpage\photos.html
...
Last edited by hexkid on Sun Nov 26, 2006 5:30 pm; edited 1 time in total
| Kath wrote: |
Thanks for your help guys! esp hexkid.
I am still struggling alittle.
I have made two files;
"LOGIN.htaccess"
"LOGIN.htpasswd"
|
As hexkid said, the files must be name .htaccess and .htpasswd, get rid of the LOGIN
Thank you thank you thank you!
-Kath
Easy way. Make your directory password protected using cpanel. Create a user and password for that directory. You can distribute this user name and password to who ever you want to give access to. No scripting required.
I'm trying to implement .htaccess abd .htpasswd on my site. I have placed both files in the same directory as the files I wish to protect.
My .htaccess file looks like this
| Code: |
require valid-user
AuthType Basic
AuthName "Steve Williams"
AuthUserFile .htpasswd
|
Not sure if I should change the AuthName bit or not?
and my .htpasswd looks like this
| Code: |
steve:19abertawe76
guest:T35ht9
|
Here's the site. Can't get it to work. It prompts for the login information, but neither username/password works
http://swweb.frih.net/
| welshsteve wrote: |
and my .htpasswd looks like this
| Code: |
steve:19abertawe76
guest:T35ht9
|
|
Use Web Page Password Generator and make your .htpasswd look like this | Code: |
steve:fJmzgjMcqRNC2
guest:fT8VgAv/5pg.M |
I've tried that and it still won't work.
Specify the full pathname to the .htpasswd file in the .htaccess | Code: |
require valid-user
AuthType Basic
AuthName "Steve Williams"
AuthUserFile /home/YOURUSERNAME/domain/YOURDOMAIN/public_html/protected/.htpasswd |
| hexkid wrote: |
Specify the full pathname to the .htpasswd file in the .htaccess | Code: | require valid-user
AuthType Basic
AuthName "Steve Williams"
AuthUserFile /home/YOURUSERNAME/domain/YOURDOMAIN/public_html/protected/.htpasswd |
|
Many Thanks. Got it working now 
Hi again guys,
I have my website up and running now....
I have all of my files for the website in my \public_html
The website works beautifully....
Issue comes when I add the .htaccess and .htpasswd to the \public_html
The login screen comes up when I try to go into the actual domain but when I type in the username and the normal password (encrypted version in the .htpasswd <from the Troy website>) it keeps bringing up the login screen about three times and then I get a message saying that I can't have access to the site.
Can anyone tell me what I have done wrong.
Thanks
-Kath
| Kath wrote: |
Issue comes when I add the .htaccess and .htpasswd to the \public_html
The login screen comes up when I try to go into the actual domain but when I type in the username and the normal password (encrypted version in the .htpasswd <from the Troy website>) it keeps bringing up the login screen about three times and then I get a message saying that I can't have access to the site.
Can anyone tell me what I have done wrong. |
Oops ... the Troy website generates password files improper for Windows.
Use the "htpasswd" that got installed with Apache on your Windows to create the .htpasswd file.
In my test system, I do | Quote: |
C:\Utils\Apache2\bin>htpasswd -c -b \htdocs\www\test\.htpasswd Kath guest
Automatically using MD5 format.
Adding password for user Kath |
and the .htpasswd file contents are | Quote: |
C:\Utils\Apache2\bin>type \htdocs\www\test\.htpasswd
Kath:$apr1$nI1.....$.no7Ltl0tdz1ziwUiYvcB1 |
[Edit]: type htpasswd without parameters for an usage screen.
[Edit again]: The username and password are case sensitive!