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? 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. Link to comment https://forums.phpfreaks.com/topic/88279-solved-ifthen-with-url/#findComment-451758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.