I'd like a code to check if the referrer URL of a visitor to my Website is registered on a list, so then it will give back one alert or another. I have tried this, but doesn't work, and it can just check if the visitor is coming from a specific URL, not checking a list as I want:
<?php
if (ref.match(/^https?:\/\/([^\/]+\.)?friendsite\.com(\/|$)/i)) {
alert("You came from a friend Website");
else { alert("You came from a non friendly Webstie");
}
?>