...

View Full Version : How Do I Password-Protect My Webpage?



Doctor_Varney
01-05-2010, 11:43 AM
I want to make a webpage to upload photographs, viewable only to select users. When they arrive, I want them to see a password login. Once they are through, then they can view the designs.

Where to begin?
Do I need to talk to someone at Virgin Internet or can I do it myself?
Can it be done with HTML or will I need some other kind of programming language?

Thanks

Dr. V

Kor
01-05-2010, 11:52 AM
You need a server-side language (+ a Data Base) which will analyze a HTML submit - most commonly PHP/MySQL

Or you may use a .htaccess password (but for an unique user/pass) - most commonly for Apache web servers.

Doctor_Varney
01-05-2010, 11:54 AM
Where/how do I learn how to use this "PHP/MySQL"? Is there something I can download?

I just need something very simple, to offer peace of mind to the client.

Doctor_Varney
01-05-2010, 12:01 PM
I must add, this can't be complicated or I'll have to abandon it. I'm doing so much work on the designs, there is no time to learn a new complicated language. Is there some kind of template I can download or would anyone be willing to share some code with me, that they have used?

Edit: I have just found this http://www.javascriptkit.com/howto/htaccess.shtml
Which I couldn't find before, because I didn't know that I should be looking up .htaccess in the first place. I just looked up 'how to make a password'.

Many thanks

Dr. V

Kor
01-05-2010, 12:08 PM
I must add, this can't be complicated or I'll have to abandon it. I'm doing so much work on the designs, there is no time to learn a new complicated language. Is there some kind of template I can download or would anyone be willing to share some code with me, that they have used?

Many thanks

Dr. V
Once again: There is no way. You may prevent the right click (but probably only in some browsers), but why to do that? It will be of no use.

Doctor_Varney
01-05-2010, 12:12 PM
Now I've just hit a road block, because the author doesn't explain what he's saying.

"htaccess files must be uploaded as ASCII mode, not BINARY. You may need to CHMOD the htaccess file to 644 or (RW-R--R--)."

Can anyone please explain above sentence, please? Because I haven't a clue what he's talking about!

Dr. V

Doctor_Varney
01-05-2010, 12:15 PM
Once again: There is no way. You may prevent the right click (but probably only in some browsers), but why to do that? It will be of no use.

No, I'm not interested in what mouse button people are using... I want a password login, as I said. Even I have circumvented non-right click pages. The point is, I don't want just anyone to see the designs. I don't care whether they can download them or not, the designs have to stay entirely secret.

So where can I find code that will do this for me? Links, please?

Dr. V

Kor
01-05-2010, 03:05 PM
password login? Use a server-side application and a DB.

oracleguy
01-05-2010, 04:26 PM
Now I've just hit a road block, because the author doesn't explain what he's saying.

"htaccess files must be uploaded as ASCII mode, not BINARY. You may need to CHMOD the htaccess file to 644 or (RW-R--R--)."

Can anyone please explain above sentence, please? Because I haven't a clue what he's talking about!

Dr. V

The ASCII versus BINARY mode thing is a setting in your FTP client. And your ftp client will let you set the permissions which is what CHMOD is for. Once you've uploaded the file onto the server.

htaccess will let you have username and passwords like you want however the login form will be a pop up dialog from the browser, it won't let you have the form on the page. It still may suffice for what you want though.

However the more robust solution is as Kor said to use a server side script with a database.

itsallkizza
01-05-2010, 04:39 PM
If you want it simple...


1) Create a new file and name it ".htaccess" (you may need to create this directly on your server if you are using Windows for development because Windows requires a string before the extension).


2) Open up ".htaccess" and copy this code:
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /usr/local/apache2/htdocs/.htpasswd
Require valid-userNote: "/usr/local/apache2/htdocs/" can be any folder (however it's recommended you place it above your root http accessible directory for security purposes).


3) Copy ".htaccess" into the directory you would like to protect. This can be your root folder (e.g. htdocs/) if you want to protect everything on your domain.


4) Create a new file and name it ".htpasswd".


5) Open up ".htpasswd" and copy this code:
guest14:GmbIGGkm23nTI"guest14" is the user name and "GmbIGGkm23nTI" is the encrypted password. In this case "access7289" is the unencrypted password. You can use free encryption tools such as this one to generate new passwords: http://tools.dynamicdrive.com/password/


6) Copy ".htpasswd" into /usr/local/apache2/htdocs/ on your server (or whatever folder you directed your ".htaccess" file to check).


You're done!

sir.jones
01-05-2010, 08:18 PM
@ Doctor_Varney
if you plan give your visitors access by yourself (manual) you can do it by .htaccess password
but if you plan your visitor able to register 1st then open your (another) page you must be create / work with server side code and also database

there are many options you can do:
PHP (most famous then the others)
with
MYSQL /porgeSQL (as database)
MYSQLlite (as database)
CSV (as Database)
Flatfile (as Database)

if you are limited knowledge about coding and don't enough time to learn it more (or unsure) i suggest you using PHP + plaintext (for this i can help you freely if your project doesn't large.:)

Kor
01-05-2010, 08:23 PM
By short: either you learn how to do it, or you hire a professional.

CoffeeCup.com
01-07-2010, 04:36 PM
Hello,

Please visit the following sites to see if any of these can help you out:

http://css-tricks.com/easily-password-protect-a-website-or-subdirectory/
http://www.coffeecup.com/website-access-manager/
http://www.2createawebsite.com/enhance/password-protect.html

Hope these help!!! :thumbsup:
CoffeeCup.com

Doctor_Varney
01-08-2010, 06:15 PM
password login? Use a server-side application and a DB.

Yes, but WHAT server-side application?!

Thanks for your help, but surely, I shouldn't need to hire a professional, just to set a password on a page.

Doctor_Varney
01-08-2010, 06:19 PM
If you want it simple...


1) Create a new file and name it ".htaccess" (you may need to create this directly on your server if you are using Windows for development because Windows requires a string before the extension).


2) Open up ".htaccess" and copy this code:
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /usr/local/apache2/htdocs/.htpasswd
Require valid-userNote: "/usr/local/apache2/htdocs/" can be any folder (however it's recommended you place it above your root http accessible directory for security purposes).


3) Copy ".htaccess" into the directory you would like to protect. This can be your root folder (e.g. htdocs/) if you want to protect everything on your domain.


4) Create a new file and name it ".htpasswd".


5) Open up ".htpasswd" and copy this code:
guest14:GmbIGGkm23nTI"guest14" is the user name and "GmbIGGkm23nTI" is the encrypted password. In this case "access7289" is the unencrypted password. You can use free encryption tools such as this one to generate new passwords: http://tools.dynamicdrive.com/password/


6) Copy ".htpasswd" into /usr/local/apache2/htdocs/ on your server (or whatever folder you directed your ".htaccess" file to check).


You're done!

Many thanks, sir! That is a beautifully concise answer. At least I'll be able to try this.

Most helpful... Have thanked you for you post, mate.

Regards

Dr. V

Doctor_Varney
01-08-2010, 06:19 PM
Hello,

Please visit the following sites to see if any of these can help you out:

http://css-tricks.com/easily-password-protect-a-website-or-subdirectory/
http://www.coffeecup.com/website-access-manager/
http://www.2createawebsite.com/enhance/password-protect.html

Hope these help!!! :thumbsup:
CoffeeCup.com

Great resources. That's kind of what I was looking for. Many thanks to you, too!

Regards

Dr. V



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum