Home » Php » PHP 7.0 – HTTP_REFERER only contains domain name

PHP 7.0 – HTTP_REFERER only contains domain name

Posted by: admin October 23, 2018 Leave a comment

Questions:

I need to check the referrer of a page that has an iframe pointing to our web site

apparently it only contains the domain name, not the whole url of the mother page

I have no idea if it’s a php setting or apache setting, I cannot find any info about this

if(isset($_SERVER['HTTP_REFERER']) && ($_SERVER['HTTP_REFERER']!=""))
    $referrer=$_SERVER['HTTP_REFERER'];

it only contains

https://www.somedomain.com/

without the extra path

https://www.somedomain.com/path/parameter

how can I solve this ?

regads

Answers: