The quickest way to get a password protection system up and running is to use a Prompt box in JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know what the password should be, could even be one each, that can be sorted out at the next page then pass the "input" directly through the url by changing the .href, like http://forums.xisto.com/no_longer_exists/= The page that then processes this should also check for the referring page, and three fails from an IP if you like the php (the next page):
<?php// processdownloads.phpif (!isset($_POST['leTmeIn'])) {?><script language=JavaScript>location.href=document.referrer;</script><?php} else {?>put all your download stuff here<?php}?>
the javascript (the first page): <a href="" onclick="return(doOpen());" >downloads</a><script language=JavaScript>function doOpen(){ pw = prompt('Enter your Email Address',''); if (pw){ location.href='processdownloads.php?'+pw+'=' return(false); } }else{ return(false); }</script>
This is a cheats way of dealing with hackers, crackers or anyone else who shouldn't be where you dont want them to be. leTmeIn is the password here This is quick and simple, but leaves an ugly url and therefore would not be ideal for anywhere that someone could look over your shoulder, or go through you history, but can be hidden in frames a simple PHP only version would be: <?phpif (!isset($_POST['submit'])) {?><form action="" method="post"><input type="password" name="email"><input type="submit" name="submit" value="Submit"></form><?php} else { $pass = $_POST['email']; if ($pass!="leTmeIn") {?><script language=JavaScript>location.href=document.referrer;</script><?php }else {?>put the rest of the page here<?php }}?>
I hope it helps someone. PS: This is my first post