I want my website to check if the current visitor's IP Address is or isn't in a text file and if it is I want to assign a value.
<?php
$list = file("checkip.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$listarray !== (in_array($_SERVER['REMOTE_ADDR'], $list));
if ( $listarray )
{
$value = "IP NOT FOUND IN FILE";
}else{
$value = "IP FOUND IN FILE";
}?>
<?php echo $value ?>
I placed my ip address in the checkip.txt file and it ends up displaying "IP FOUND IN FILE"
I have tried testing =
and !==
for $listarray
but still no luck