change 'HTTP_REFERER' value

Started on the old forum in November 2010 · view the original in the archive · old links redirect here

5 replies · 2,086 views · started 16 years ago · 1 min read

5 participants
ionutvmi Junior · 45 posts #1

anybody knows if is posible to change the 'HTTP_REFERER' value in php. For example if an user in on page a.php and click to page b.php on page b.php i want 'HTTP_REFERER' to be set by me.

PIMP-WAP.NET - PIMP YOUR MOBILE

MASTER-LAND.NET - WAPMASTERS LAND

kei_ki7 Senior · 431 posts #3

I use GET method, but you can use also cookie or session that can handle the refer.

For a.php

<?php
$refer = $_SERVER["REQUEST_URI"];
echo '<a href="b.php?refer='.$refer.'>Link to B Page</a>';
?>

For b.php

<?php
$refer = $_GET["refer"];
echo '<a href="'.$refer.'">Back to referer page</a>';
?>

Hope it helps. Btw for accurate referrer use CURL. Curl has function to get the referer.

Did I help you? You can help me too Your donations will help me finance my studies.

sm4rtgl0b3 Junior · 11 posts #5

$_SERVER['HTTP_REFERER']="me"; $_SERVER['REQUEST_URI']="me";

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close