Secure your page

Joined
Dec 15, 2007
Messages
396
Reaction score
99
Secure your page,
Only PPL with IP on the script can access to the website
if someone try to access your site it will say it
Code:
You don't have permission to access this page.
Contact the administrator for have access.

Denied.php
Code:
<!-- Script Created by NicK -->
<div align="center">
  <p>You don't have permission to access this page.</p>
  <p>Contact the administrator for have access.</p>
</div>
<!-- Script Created by NicK -->

P.S. PHP ONLY its not htaccess.

Add it on the TOP of your PHP Source.
PHP:
<?php
// Scripted by NicK
$ip = ''.($_SERVER['REMOTE_ADDR']);
if (!(($ip == '333.333.333') || ($ip == '333.333.333') || ($ip == '333.333.333') || ($ip == '333.333.333') || ($ip == '333.333.333') || ($ip == '333.333.333') || ($ip == '333.333.333')))
// edit the IP
// you can add more if you want
{
include 'denied.php';
exit();
}
?>

and create a denied.php
its the error page.



Scripted by me.
Enjoy it :laugh:
 
Lol...

PHP:
if ($_SERVER['REMOTE_ADDR'] != "127.0.0.1")
{
die();
}

this only allows non-localhost users to not get access, which makes it useless.

the best way is just:

Code:
if ($_SERVER['REMOTE_ADDR'] == NULL){
echo "no access";
echo "die.";
}

Also it's impossible to "not have an ip address", every host gets signed with one.
 
Back