samtay Posted July 20, 2007 Share Posted July 20, 2007 Hey Everyone, How can I get the domain from $_SERVER['HTTP_REFERER']. For Example: If $_SERVER['HTTP_REFERER'] = http://example.com/somepage/2 then I only want example.com. Also If $_SERVER['HTTP_REFERER'] = http://www.example.com/somepage/2 then I only want example.com, this also apply to other sub domains too. Cheers Samuel Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 parse_url() Should do the trick Quote Link to comment Share on other sites More sharing options...
samtay Posted July 20, 2007 Author Share Posted July 20, 2007 Cheers for the reply, would this give me the sub domain? Samuel Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 Not sure, give it a go and see! Quote Link to comment Share on other sites More sharing options...
samtay Posted July 20, 2007 Author Share Posted July 20, 2007 Thanks for helping Samuel Quote Link to comment 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.