Nasıl kullanıcı PHP mayın erişmeden önce gelen sitesi algılayabilir?
Bu deneyin:
$_SERVER['HTTP_REFERER']
Daha fazla bilgi için, bkz: HTTP referrer lütfen:
The referrer, or HTTP referrer—also known by the common misspelling referer that occurs as an HTTP header field—identifies, from the point of view of an internet webpage or resource, the address of the webpage (commonly the URL, the more generic URI or the i18n updated IRI) of the resource that links to it. By checking the referrer, the new page can see where the request came from.
Sen Referer HTTP Header, çek a> olabilir:
echo $_SERVER['HTTP_REFERER'];
But note that the Referer is sent by the browser, which means :
So, you can use the referer to provkimlike an additional feature on your website, but you have to make sure that your website doesn't rely on it : your application must still work, even if the Referer is not present.
Andrew Hare devletler @ gibi in his answer, (HTTP isteğinin parçası olarak gönderilen bir başlıktır) HTTP_REFERRER sunucu değerini almak size tarayıcısının son siteyi anlatacağım.
Belirtmek gerekir, ancak, bu başlık / sunucu değişken meşru nedenlerle, bazı varlık bir dizi için, hiçbir değere sahip olacağı tamamen mümkün olmasıdır:
Yukarıdakilerin hepsi aynı şey, aynı tarayıcı penceresi başka bir siteye gitmek için kullanılan bir durumda gerçekten farklılıklar vardır, ama orada onlara yol bir belge, bir yönlendirme, ya da bir linke tıklayarak aracılığıyla istenmez oldu diğer bazı eylem seninkinden önce tarihinin sayfası tarafından istendiğinde.
Sen HTTP Referer Soket bakmak gerekir:
$_SERVER['HTTP_REFERER']
PHP Documentation daha fazla HTTP Başlıkları için bakın