Secure Admin Section(Using IP)
So this will make it so that You have to be on one computer to enter your admin Section. Now If you do alot of traveling, or update your site when you're out lots. Possibly just have this protecting certain pages, And leave the Add news pages with default log in?
Code
$accept = array ("127", "0", "0", "1");
Put the ip that you want to be able to see the page here. Edit this.
Code
$remote = explode(".", $REMOTE_ADDR);
$match = 1;
for ($i = 0; $i < sizeof($accept); $i++) {
if($remote[$i] != $accept[$i]) {
$match = 0;
Now this will check to see if you IP is the same as the Specified one. Leave this.
Code
if ($match) {
echo "Access Granted";
} else {
echo "Access Forbidden";
}
If the IP does match. It echos "Access Granted" So you would edit that to show the admin part. If they do not match. It will show "Access Forbidden". You could leave that blank. And have this as a option at the bottom of the Admin Page to possibly edit site data? For example. Site Title or Site Slogan?
Here is the code after its all put together
Code
<?
$accept = array ("127", "0", "0", "1"); // IP Address that is allowed to see site
$remote = explode(".", $REMOTE_ADDR);
$match = 1;
for ($i = 0; $i < sizeof($accept); $i++) {
if($remote[$i] != $accept[$i]) {
$match = 0;
}
}
if ($match) {
echo "Access Granted";
} else {
echo "Access Forbidden";
}
?>
Hope someone will be able to use this!