...

View Full Version : Password Protecting One Page



ecntrc
12-23-2005, 11:49 AM
Id like to password protect a page on my site, www.ecntrcbeauty.org the treasure box page. I need the viewer, to enter a user ID and a password and then be directed to another page. I looked up javascripts for this but it said that it wasnt the best way, but only way if you dont have a CGI BIN on your domain. I have a CGI BIN, what is the best way to do this? Could anyone help me out? Ive contacted my hosting service, I was reading on one link, that you should contact your hosting service to make sure that it wont mess up your files and things like that.. Does anyone know how to do this and could help me out? Id appreciate it alot. Thanks

ps theres nothing currently on the page because Id like to set everything up first.

chud_wallice
12-23-2005, 05:36 PM
Hi

no Javascript won't do this.(well not if the user disables it any way)
Can you use PHP or ASP with your host?

how many users will need access to this page? Is is just for you to update content? Or do you want a login system where each user has to create an account before accessing your restricted content?

ecntrc
12-23-2005, 06:08 PM
Can use PHP and Im not sure about ASP. No, my users wont need to make a user name, I will make a default user name and password that all users will type in to access this page. This page is for my son actually. Dosent seem like someone would want to password protect a page for their son but Ive seen too much stealing of pictures and claiming that its their kid or someone figuring out where you live, that type of thing. No Im not paranoid Im being cautious. Yes the interenet is big and maynot be possible but someone people are more smarter than you think. So with that said, I hope you can still help me.

felgall
12-23-2005, 10:02 PM
Take a look at http://www.felgall.com/php3.php which shows a way to use PHP to password protect the content of the current web page.

ecntrc
12-23-2005, 10:16 PM
Hello
I tried your password protect, I followed the directions, the login box shows, and then I added in my content and then the code that follows my content but my content showed as well as the login box.. im not sure what I am doing wrong..

_Aerospace_Eng_
12-23-2005, 10:19 PM
Who is your webhost? You might be able to use htaccess. Some webhost have control panels that make password protecting easy.

ecntrc
12-23-2005, 10:22 PM
I already talked with them through email and she recommended not to use htaaccess because it will mess up my domain. I also read up on it a few weeks ago and it also said that to check with your domain when using htaaccess because it will mess with your domain, I also used the password protection directory on my cpanel and for some reason that wouldnt work either. I did what I was suppose to and not sure why its not working. Also my domain supports PHP scripts

_Aerospace_Eng_
12-23-2005, 10:23 PM
Mess up your domain in what way? I have been using it for quite some time now, and htaccess has worked for me.

ecntrc
12-23-2005, 10:31 PM
Password Protecting Pages

You should not use .htaccess to password protect because it could bring
your entire site down.

CPanel will allow you to protect a folder, not a single page. So what
you can do is create a folder and upload the file to it, then protect
that folder using CPanel.


http://www.freewebmasterhelp.com/tutorials/htaccess/

If she is going to recommend me not to use it Im not going to because I dont want to have problems with my site.

Spookster
12-23-2005, 10:47 PM
Password Protecting Pages

You should not use .htaccess to password protect because it could bring
your entire site down.

CPanel will allow you to protect a folder, not a single page. So what
you can do is create a folder and upload the file to it, then protect
that folder using CPanel.


http://www.freewebmasterhelp.com/tutorials/htaccess/

If she is going to recommend me not to use it Im not going to because I dont want to have problems with my site.

I'll have to say whoever that is working at your webhost doesn't know what they are talking about. The best and easiest solution for your case is to use .htaccess. As a matter of fact I am almost certain when you use CPanel to password protect things it uses .htaccess to do so.

ecntrc
12-23-2005, 10:58 PM
I'll have to say whoever that is working at your webhost doesn't know what they are talking about. The best and easiest solution for your case is to use .htaccess. As a matter of fact I am almost certain when you use CPanel to password protect things it uses .htaccess to do so.

I asked her to explain to me why it isnt recommended to be used and what would happen, er how she would know that it would bring my site down and I also asked her what they use for their password protect. Because now Im not so sure now.

www.netrillium.com my hosting service

Spookster
12-23-2005, 11:52 PM
I asked her to explain to me why it isnt recommended to be used and what would happen, er how she would know that it would bring my site down and I also asked her what they use for their password protect. Because now Im not so sure now.

www.netrillium.com my hosting service

If you put an .htaccess file in your root directory with the wrong commands or with password protection you could prevent people from viewing your site. But you will know it as soon as you do it. In your case what you will want to do is create a directory that you want to protect and put the html file in that directory. You will also put the .htaccess file in that directory. This will protect all files in that directory and any subdirectories in there. The .htaccess file works with a .htpasswd file. So basically your .htaccess file provides a command to the webserver to do perform a certain action. In this case you can tell it to prevent access to this directory and prompt the user for a login. Your .htaccess file then tells the webserver to go look in the .htpasswd file for the correct login. It's pretty simple and easy. If you do a search in the forums here for htaccess you will pull up examples and instructions on how to do it and we can answer any specific questions you might have.

ecntrc
12-24-2005, 01:38 AM
Yes that is actually what they have on my cpanel. I tried it a couple times and it didnt work. But Ive used their help desk and shes helping me out, its just the wait period until she emails me back. Thanks for your help guys. I appreciate it



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum