Alright I'll try to be as clear as possible. I'm currently doing tutorials online because I'm learning php. I'm stuck on an issue I'm not really sure of. I'm currently coding on my local machine and think it may have something to do with that, but I'm not sure. Here it is.
This currently involves 2 files(count.php and ip.txt)
Here's the first script(count.php):
<?php
function hit_count() {
$ip_address = $_SERVER['REMOTE_ADDR'];
$ip_file = file('ip.txt');
foreach ($ip_file as $ip) {
$ip_single = trim($ip);
if ($ip_address!=$ip_single) {
$found = false;
} else {
$found = true;
}
if ($found==false) {
echo 'IP not found.';
}
}
}
?>
And the second one is simply(ip.txt):
All random numbers I came up with for testing purposes.
::1
100:100:1000
123:234:345
I cannot get this display in the browser. I'm not sure if it's my local machine, the coding, etc.