I need some help with PHP code. I have popup on my site, but want to exclude it if visitor comes from certain site. How can I do that ?
if (!empty($_SERVER['HTTP_REFERER']) AND $parts = @parse_url($_SERVER['HTTP_REFERER'])) { $blocked_hosts = array('some.com', 'site.com', 'blah.com'); $host = preg_replace('~^www\.~', null, strtolower($parts['host'])); if (!in_array($host, $blocked_hosts)) { // Request comes from one of the sites that's NOT in the array above. } else { // You know the deal } } PHP: