HTTP_REFERRER in Zend Framework

What is HTTP_REFERRER?

If you need to know how called a PHP script, it is normally setup in the $_SERVER variable of HTTP_REFERRER, or simply

$_SERVER['HTTP_REFERRER'];

but in the same time this does not work the same way in Zend Framework, just because everything is passing by the index.php or a custom bootstrap!

Unfortunately there’s no so many resources online, however there is a solution, which seems to be pretty natural. You can just use this chuck of code:

$this->getRequest()->getHeader('REFERER');

and that’s all!

2 thoughts on “HTTP_REFERRER in Zend Framework

  1. Hi,
    Know you how i can get param from referer url?
    Something like..
    $referer = $this->getRequest()->getHeader(‘REFERER’);
    $referer->getParam(‘something’);

    ?

Leave a Reply

Your email address will not be published. Required fields are marked *