View Full Version : password protecting
Cmrdrv
08-07-2003, 04:28 AM
Would it be possible to use this tutorial http://www.javascriptkit.com/script/cut76.shtml and a another script so it detects an ip address and only allows a certain ip.
theabyss
08-07-2003, 11:07 AM
That script in insecure. I can view the source and the password's right there. Here is a much better version:
http://dynamicdrive.com/dynamicindex9/password.htm :cool:
<?edit:msg?>
if (form.id.value=="JavaScript") {
if (form.pass.value=="Kit") {
location="page2.html"
Here's the username and password in first script :eek:
redhead
08-08-2003, 10:18 AM
client side password protection (using javascript, for example) is never totally secure (although, i think there was one that none of us could crack) and if you search for "Detect IP address" or something similar in the javascript section you'll probably find that very few browsers can detect their IP address (afaik, IE cant)
also, IP address arnt always the same, if you disconnect and connect again your IP address will probably change.
so, javascript is not the best way to do this, but i guess if youve got a PHP enabled server you could do something like this:
if ( $_SERVER["REMOTE_ADDR"] == "11.11.111.111" ) { // change to "correct" IP address
header('Location: http://www.google.com') // site/page to go to
} else {
die('you have the wrong IP address');
}
:thumbsup:
oracleguy
08-09-2003, 06:48 PM
Or you could do a username/password thing in a similar fashion. Or if you have available to you, htaccess.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.