Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get full referrer url in php

I want to get full referrer url in PHP. For instance, if I come to mywebsite from a google search, $_SERVER['REFERER'] gives me only www.google.com, but I want smth like www.google.com/search?q=KEYWORD

Google Analytics provides that for many search engines. I need to get "/search?q=KEYWORD" query string.

like image 898
halilenver Avatar asked Feb 01 '13 20:02

halilenver


1 Answers

Put this in your script and have a look at it's content;

<pre>
<?php
var_dump($_SERVER);
?>
</pre>

This way you can find out which keys contain 'what'

like image 92
thaJeztah Avatar answered Sep 20 '22 19:09

thaJeztah