View Full Version : Password Protecting Certain Pages
Paul1
09-18-2002, 04:58 PM
I have Dreamweaver 4 and would like to create a way to password protect certain pages. I am a photographer and want to protect some client folders but not others.
Can anyone tell me how to do this - BUT PLEASE, put it in very simple terms and instructions. I do not know code or any of this fancy language you guys use. Be gentle !!
Is there something I do in Dreamweaver (Dreamweaver Help didnt cover the password topic) or does the server people do something ? Can I do it inside DW or do I have to get another something in addition to DW ? Augh !!
I did do a search on this forum about passwords and read some of those but am probably more confused now !!
Thanks
Paul
Morgoth
09-18-2002, 05:53 PM
What's best is to use a server side language and have the users information be stored in a db. But next best thing is Java. Maybe even flash. But beware of scripts that will let the password be visable on the client side.
tommysphone
09-18-2002, 05:57 PM
Hi :)
Does or can your web spce provider provide Password protection - example
You can password protect areas of your website and authenticate users from a text file or any ODBC database. This can be achieved without any scripting and is controlled by the server giving high security and a professional image to visitors.
The service provider if they can do this will give you a nice easy to use front end and off you go.
Failing that it gets tricky. Unless anyone knows anything I don't which is possible.
Spookster
09-18-2002, 07:17 PM
Or you could use an .htaccess file in the client's directorys to enable password protection for that directory. Each of those .htacess directories could refer to one centrally located .htpassword file located above the root directory of your site.
Paul1
09-18-2002, 07:43 PM
OK Spookster... you have my interest with that one. Exactly HOW do I do this ??
Step by step, in VERY SIMPLE terms / instructions. Lets imagine I do not have a clue about code (which is true). :)
Thanks
Paul
Spookster
09-18-2002, 07:52 PM
Well that's easy. One of our moderators (Feyd) here wrote a tutorial on how to use .htaccess.
http://www.javascriptkit.com/howto/htaccess.shtml
ddubs
09-19-2002, 03:50 AM
Just a quick idea...
Of course you will want to use a better method when you get it together. It ussually depends on what you protecting and how important it is to you.
You could simply do some of the things explained above. I ussually use asp and sql to store passwords, as well as other user information in an access database. But there are many options and many levels to which you can take to protect your site.
For now, hear is a temporary solution you could have ready in no time. And you can add this code right into Dreamweaver.
Just copy the code to every page you want to protect, and change the two fields in bold.
You can always simply remove this from your pages when you get what you need to do it a more professional way.
<!--Insert in body-->
<script language="javascript">
var message="Please enter your password.";
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//-->
</script>
<script language="javascript">
<!--//
var word;
var pass;
pass = "This is where you store your password";
word=window.prompt("Log In:","Please enter your password:");
if (word==pass) {
location = "Name of file to open if password is correct";
} else {
window.history.back();
}
// -->
</script>
...you could also hide this page by using frames...just another idea.
....I know its not the best thing to do, but it will help until you get another plan.
Good luck:thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.