I'm trying to perform a check to see if a user visits from a certain host. I basically just need to see if the host contains a specific name or word. This is the code I have written and it produces an error. Could someone please tell me why, and what the proper way to do this would be? Thanks in advance for your help.
<?
$ip = getenv('REMOTE_HOST');
if(!$ip){
$ip = getenv('REMOTE_ADDR');
}
$host = @GetHostByAddr($ip);
if ($host LIKE '%nametosearch%') {
$host_name="y";
}
else {
$host_name="n";
}
?>