$waddr = explode("/", $HTTP_REFERER); if ($waddr[2] == ""){ exit; } $rep = substr_count("alnhr.", $waddr[2]); if ($rep > 1){ exit; }