Does anybody know where I could get scripts so I could have a password protected site. I need a password script so that you have to enter a password to enter the site and other passwords vaious sections of the site.
Thanks for any responses.
Printable View
Does anybody know where I could get scripts so I could have a password protected site. I need a password script so that you have to enter a password to enter the site and other passwords vaious sections of the site.
Thanks for any responses.
It would help if you mentioned what kind of server you are running....
Probably a combination of a users file and an .htaccess file...hard to say without knowing the server though...
Neb
You could write one yourself in java, or go to coffeecup.com. They have a program that will do it for you... You have to register it to get to use it on the web, though...
BEGIN VIRUS.EXE
There is no spoon, but you yourself that bends...
END VIRUS.EXE
Ummm, What language?
PHP
PERL
Java
Javascript
C
Python
?????
usually this is implemented via the web server's configuration or in a self contained configuration file.
if you are using iis, you can restrict anonymous access forcing a login and then use ntfs perms to distinguish who has what access. for apache the most common method is through mod_access configured in the .htaccess file located in the directory (or parent directory - or grandparent directory...) you are wanting to protect.
you can also do this through scripting (as you asked) by sending the appropriate http response header. something to the effect of:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm=""
the second request to this response should include an authorization header with a value of the authorization realm and a base64 encoded string consisting of the username and password joined by a colon.
PHP can do it all...
There are also certain remotely hosted scripts if you wanted to use them, it's a cheap way around the problem, it might be worth checking out, <a hhostedscripts.com is one, and you can find many on resourceindex.com Other than that, search goolge. But the resource index has lots o goodies
JavaScript password protection system
In the Html origin codes of a site a JavaScript code
<head><title> Website-TITLE </title>
<script>
function jprot() {
pass=prompt("Enter your password","password");
document.location.href="http://protectedserver.com/index.html";
}
else {
alert( "Password incorrect!" );
}
}
</script>
</head>
If you use a NT server with IIS, you can use the NTFS permissions, this is the easiest way to do it.
It always depends on what you want to do ! You could always use ASP, PHP and all kinds of other server side scripting and make sure you always check for a open session for the user to get the other pages in you web site structure or else anyone that as a direct link will go through without the password request !