문제

i need to use

$ref = $_SERVER['HTTP_REFERER'];
if($ref !== 'http://hi.com')

have is problem is if traffic come from http://hi.com/something condition become not true. how to test only top level domain ? thanks

도움이 되었습니까?

해결책

Make use of strpos() here

$ref = $_SERVER['HTTP_REFERER'];
if(strpos($ref,'http://hi.com'))
{
echo "found";
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top