ATM Posted December 19, 2006 Share Posted December 19, 2006 Hello,I was wondering if someone could perhaps write me some php code to check to see if the HTTP_REFERER is withinn a certain directory or even better, within a domain.Normally I wouldn't ask this but I have tried writing one and it doesn't seem to work, and I expect this script will only be a couple of lines.Thanks, Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2006 Share Posted December 19, 2006 You can use parse_url. $chunks = parse_url($_SERVER['HTTP_REFERER']); $chunks['host'] will have the hostname, and $chunks['path'] will have the path.http://www.php.net/manual/en/function.parse-url.php Link to comment Share on other sites More sharing options...
ATM Posted December 19, 2006 Author Share Posted December 19, 2006 Thanks, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now