mcmuney Posted January 28, 2008 Share Posted January 28, 2008 I'd like to use $_SERVER['HTTP_REFERER'] to do an if/then statement, but I don't want to look for the full URL but only th domain. For example, $_SERVER['HTTP_REFERER'] might return "http://abc.com/test.php", but I want to only check if url is abc.com. What's the best approach for this? Quote Link to comment https://forums.phpfreaks.com/topic/88279-solved-ifthen-with-url/ Share on other sites More sharing options...
btherl Posted January 28, 2008 Share Posted January 28, 2008 The parse_url() function will extract the host for you. Quote Link to comment https://forums.phpfreaks.com/topic/88279-solved-ifthen-with-url/#findComment-451758 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.