PHP HTTP Referrer
问题 I have a page which accepts POSTs from a remote site. I would like to detect the domain that these POSTs are coming from. I realize that it can be spoofed but it is better than nothing. I have tried accessing the HTTP_REFERER variable but it just returns null. The page accepts POSTs from sources like PayPal (instant payment notifications) and other payment gateways. How can I get the referring call? 回答1: You spelled Referer correctly. It should be: $_SERVER['HTTP_REFERER'] 回答2: $_SERVER['HTTP