FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Website login- How?





Kath
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
fizzo
I think you can use the PHP Scripting Language to retrieve passwords and usernames of your members to a database...
hexkid
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.
DanielXP
OR if you have cpanel you can do it in there using the password directories
Kath
Thanks for your help guys! esp hexkid. Wink
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
hexkid
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
...
lukeropro
Kath wrote:
Thanks for your help guys! esp hexkid. Wink
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
Kath
Thank you thank you thank you! Very Happy
-Kath
kv
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.
welshsteve
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/
hexkid
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
welshsteve
hexkid wrote:

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.
hexkid
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
welshsteve
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 Very Happy
Kath
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
hexkid
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!
Related topics
php and mysql connection in flash based website
How to config domain setting in DirectAdmin
Login Script
directadmin login
Login System help
Invalid Login Error
having problems with sessions and login
How to Make A PHP Portal.
Login
Auto Web Login
150 frih to make this SIMPLE script
PHP Hashing and Salting
Website login?
Developing a Login Script for Website
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.