$ref = $_SERVER['HTTP_REFERER']; $pos = strpos($ref,'http://yoursite.com/members/'); $outp = ($pos === true) ? 'The referer is valid.' : 'Nice try.';