How to get full referrer url in php andrey вторник, 3 июня 2014 г. No Comment

To get referrer url, we are going to use $_SERVER variable called HTTP_REFERER.

In some cases we need to check, this page redirected from where? To fill up that "where" we should use  $_SERVER[HTTP_REFERER].

NOTE:
  • If users use a bookmark or directly visit your site by manually typing in the URL, HTTP_REFERER will be empty.
  • If the users are posting to your page programatically (CURL) then they're not obliged to set the HTTP_REFERER as well.

So, to get full referrer URL in your PHP page, we need to use,
echo $_SERVER[HTTP_REFERER];
Have any doubt, feel free to comment here!

Related Post : How to get current full URL in PHP

To get referrer url, we are going to use $_SERVER variable called HTTP_REFERER.

In some cases we need to check, this page redirected from where? To fill up that "where" we should use  $_SERVER[HTTP_REFERER].

NOTE:
  • If users use a bookmark or directly visit your site by manually typing in the URL, HTTP_REFERER will be empty.
  • If the users are posting to your page programatically (CURL) then they're not obliged to set the HTTP_REFERER as well.

So, to get full referrer URL in your PHP page, we need to use,
echo $_SERVER[HTTP_REFERER];
Have any doubt, feel free to comment here!

Related Post : How to get current full URL in PHP

by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment