is there a way so only certain IP adresses, or people can see a link to a webpage? if not wots the code for a password thing.
+rep!

is there a way so only certain IP adresses, or people can see a link to a webpage? if not wots the code for a password thing.
+rep!
Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/
i'll also give +rep![]()
Mario
You could do this:
To access it you would go to http://www.yoursite.com/yourpage.php...urpasswordherePHP Code:<?php
$password = $_GET["password"];
if( isset( $password ) )
{
if( $password == "yourpasswordhere" )
{
echo "stuff here you want only people to see";
} else {
echo "Wrong password!";
}
}
?>
Get it?
Urmm, yea, easly. Basicly u just want a backwards version of an IP blocker script (for ip method)
^^ place at top of protected page, just add to the $allow array to allow more ips to view.. just wrote it now but i think will workPHP Code:<?php
//Array of alloed ip's (continue as so.
$allow[0] = "000.000.000.001";
$allow[1] = "000.000.000.002";
$allow[2] = "000.000.000.003";
//set up start value
$alloweduser = false;
// Loop Threw All the Ips.
for($K = 0; $K<sizeof($allow); $K++)
{
//If an Ip matches the user ip set em as allowed.
if($allow[$K] == $_SERVER['REMOTE_ADDR']){
$alloweduser = true;
}
}
// stop page load if there not on allowed list
if($alloweduser == false){die("you cannot view this page.");}
?>
Want to hide these adverts? Register an account for free!