How to get the HTTP_REFERER

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
trandoductin
Registered User
Posts: 48
Joined: Mon Sep 26, 2016 4:11 am

How to get the HTTP_REFERER

Post by trandoductin » Thu Aug 03, 2017 6:59 pm

I am trying to get $_SERVER['HTTP_REFERER']
and i have tried
request_var('HTTP_REFERER', '', true, \phpbb\request\request_interface::SERVER);
and request->server('HTTP_REFERER','');
none of which seem to work so far.
I keep getting blank for the first one and some thing call on null error for the 2nd call.
Thanks in advance.
Last edited by trandoductin on Mon Aug 28, 2017 2:50 pm, edited 2 times in total.

User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 6807
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: How to get the HTTP_REFERER

Post by _Vinny_ » Fri Aug 04, 2017 6:06 am

This can help you: viewtopic.php?f=71&t=587207

Fodboldman
Registered User
Posts: 2
Joined: Thu Aug 17, 2017 11:05 am
Name: Christian Dyring Poulsen
Contact:

Re: How to get the HTTP_REFERER

Post by Fodboldman » Thu Aug 17, 2017 11:23 am

Try this

$http_referer = (isset($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'));
set_var($http_referer, $http_referer, 'string');
Christian Dyring
CEO at
https://fodboldoplevelser.dk

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: v12mike and 5 guests

cron