Hi,
I wondered if it's possible to make PHP save some info to another file on the same server.
An example:
index.php should check if the visitor's IP is allowed to open the page, if not, the IP should be added to banned_ips.php
index.php would look something like this
// Log IP Address as $ip
$ip = gethostbyname($_SERVER['REMOTE_ADDR']);
// Load allowed IP's
include('allowed_ips.php');
if ($ip != $allowed_ip){ echo "Your IP is not reckognized as an allowed IP, access denied."; exit; }
With that access denied message I would like to have the IP logged to banned_ips.php. Any way to do this ? Thanks.