PDA

View Full Version : Need a way to require visitors to login to my website


yitbos
10-06-2006, 11:44 PM
I hope someone here can help me. I've been digging and digging for a free script or something that will allow me to password protect my website so that visitors have to register and then enter a user name and password. I've found a couple but I honestly don't understand what I'm supposed to do with them to make the work.

My site is hosted with godaddy and they do not offer anything in their software packages. It is on a Linux server and I'm not sure what that means let alone what program I really need to make this happen.

My desire is to have people have a login and password (preferrably somethign they can change when they need) and they would be required to login before they can actually get to the site. I also don't want people to be able to login once and then be able to bookmark a page after they have logged in just to bypass the login process.

Can anyone out there help me with a free script that will work for this and some basic instructions on how to get things to work? I can usually figure things out when I can see specific things that I"m supposed to edit and change for me specifically. But so much of this is foreign to me, I'm just lost.

Thanks, for the help.
John

_Aerospace_Eng_
10-07-2006, 12:00 AM
I think the best option at this point is to hire someone who does know what they are doing because what you are asking is no simple task someone can just walk you through. It will require a database. A host that supports php and some php knowledge as well as database knowledge.

iota
10-07-2006, 12:13 PM
It will require a database. A host that supports php and some php knowledge as well as database knowledge.

Yes, depending on your site, a suitable db design must be normalized, i.e., what kind of user info will be included in database. eg.

usr_name
usr_pwd
usr_account_no
usr_reg_date

... and so on.

There are lots of free scripts out there but first you need to know what your hosting server provides -- the version of php, type and version of database ...etc.

But be careful before you choose your desired scripts.
Free scripts are prone to security issues than customized scripts because their source codes are easily available for finding bugs, which lets your enemies take advantage of it and crush your site.

yitbos
10-07-2006, 12:18 PM
Thanks for the reply to my question. My site is simple, we just want to post some pictures of our kids for the grandparents, friends and relatives to see. However, with the preditors out there, we thought if you had to login and could not jump behind the login screen to a specific page, that would make things safer for our children.

That's why I'm not looking to hire someone to write a script. Instead I was looking for something basic that didn't include the password and login in the source code.

mark87
10-07-2006, 12:44 PM
What you want won't require a database though; why not just have one login for the whole family to use? You could have more than one login of course but then setting which pages each person can view etc can get a bit tricky.

Why do you not want the password and login in the source? PHP is a server side language; no-one can view it as it is processed before being sent to the user as HTML.

My advice to you at the moment, as you want something easy yet secure, is to use htaccess. You can then set a un/pw for a whole directory.

http://www.javascriptkit.com/howto/htaccess3.shtml

iota
10-07-2006, 12:47 PM
we just want to post some pictures of our kids for the grandparents, friends and relatives to see.

Then I assume your site is private, meaning only you and your close circles use your site.
I guess you don't want any other to view your site.
So, a single password is quite enough.
No complicated login or database is necessary. A database should be used only for medium to large-scale sites.

Does your hosting provider support php?
If so, check this thread:

http://www.codingforums.com/showthread.php?t=91014&highlight=simple+login

oracleguy
10-07-2006, 07:10 PM
My advice to you at the moment, as you want something easy yet secure, is to use htaccess. You can then set a un/pw for a whole directory.

http://www.javascriptkit.com/howto/htaccess3.shtml

This also is my recommendation.

Troy297
10-14-2006, 02:57 PM
for what you need the easiest way would be to simply use an .htaccess file with one username and password that everyone in your family could know and use - if it isn't for corporate use then why would you need the ability to change your password/details/etc.... a good tutorial on how to setup and .htaccess file is:

http://www.ilovejackdaniels.com/apache/password-protect-a-directory-with-htaccess/1/

although you should definitely remember that this only works for one directory/folder - to protect multiple you would need to have multiple .htaccess files - or if you also want - with some of the more complicated .htaccess functions you can validate by IP Address.

OR

I create a simple login script - that only requires PHP and you can make as many users as you want - all you have to do is put a code snippet at the top of the page to protect it.....

http://www.qscriptz.abshost.net/scripts_myadmin.php