Get referrer value in php and javascript

The referrer is the page URL that originally generated the request for the current page view or object. For accessing referrer value in PHP and javascript use $_SERVER and document object.

Access referrer in javascript

window.document.referrer
//OR
document.referrer

Access referrer in PHP

echo $_SERVER['HTTP_REFERER'];