Contents |
eV::ipBlockCheck($ipAddress,$forwardOnBlock) checks if the passed IP address has been selected in administration as a 'blocked' address. Blocked addresses have been selected in administration from form submission tools including campaign subscribers, custom forms, poll/forum postings, etc. IP blocking is used to curve spam and inappropriate form submission on the web site. An IP is blocked with the intention of not allowing visitors from the blocked IP to submit form data anywhere on the site.
$bool = eV::ipBlockCheck($ipAddress[,$forwardOnBlock]);
Boolean TRUE/FALSE is returns IF $forwardOnBlock is not passed or empty. TRUE is returned if the IP address IS BLOCKED. FALSE is returned if IP address IS NOT BLOCKED.
// forward to home page with message // if visitor's IP is blocked // recommend placing in the pre-process block of the template eV::ipBlockCheck($_SERVER['REMOTE_ADDR'],'index.php?message=You are blocked and cannot view the requested page');
// Check if ip address is blocked // return content appropriate $isBlocked = eV::ipBlockCheck($_SERVER['REMOTE_ADDR']); if($isBlocked){ echo "Your IP is blocked"; } else { echo "YOur IP is not blocked"; };