How can I get Referrer URL with PHP?
问题 How can I get Referrer URL with PHP but the DIRECTORY only not the whole link (so without http://domain.com/) only the directory? e.g: Referrer: /contact/user/9443/ but not this http://domain.com/contact/user/9443/ Thank You! 回答1: I don't have PHP installed at the moment, but you could try using parse_url. This should do it I think: parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH); 回答2: What you're asking for is the referrer's path, which may or may not be on the current site, so in general