Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the referrer URL in php ( including parameters )

Are there any HTTP Headers I could use to grab the entire referrer URL using a webserver/server-side scripting? Including query string, et cetera?

like image 853
meder omuraliev Avatar asked Jul 26 '09 05:07

meder omuraliev


People also ask

How get referrer URL in PHP?

$_SERVER['HTTP_REFERER'] will give you the referrer page's URL if there exists any. If users use a bookmark or directly visit your site by manually typing in the URL, http_referer will be empty. Also if the users are posting to your page programatically (CURL) then they're not obliged to set the http_referer as well.

How do I find the URL of a referrer?

To check the Referer in action go to Inspect Element -> Network check the request header for Referer like below. Referer header is highlighted. Supported Browsers: The browsers are compatible with HTTP header Referer are listed below: Google Chrome.

What is $_ server [' Http_referer ']?

$_SERVER['HTTP_REFERER'] Returns the complete URL of the current page (not reliable because not all user-agents support it) $_SERVER['HTTPS'] Is the script queried through a secure HTTP protocol.

How do you specify a URL parameter?

To identify a URL parameter, refer to the portion of the URL that comes after a question mark (?). URL parameters are made of a key and a value, separated by an equal sign (=). Multiple parameters are each then separated by an ampersand (&).


1 Answers

You should be able to grab it from the $_SERVER['HTTP_REFERER'] variable.

like image 53
Tyler Carter Avatar answered Oct 22 '22 12:10

Tyler Carter