Hello guys,
I am on page a.php and need to send user to b.php.
If I give him an href to click, on b.php I can get as $_SERVER['HTTP_REFERER'] the http://domain/a.php value.
If I send him to b.php with header "Location" or "Refresh", b.php has BLANK / EMPTY HTTP_REFERER...
How can I automatically send user to b.php but keep HTTP_REFERER working ???
Redirect Page but KEEP HTTP_REFERER working ???
Moderator: General Moderators
Untested
a.php
b.php
and yet another way...
a.php
b.php
a.php
Code: Select all
session_start();
$_SESSION['referrer'] = $_SERVER['HTTP_REFERER'];
// header redirect...Code: Select all
session_start();
$referrer = $_SESSION['referrer'];a.php
Code: Select all
header("Location: http://sitename.com/b.php?referrer=" . $_SERVER['HTTP_REFERER']);Code: Select all
$referrer = $_GET['referrer'];- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
i dont mean how i can pass between the two scripts the variable referer or the data, i know about sessions and lot other methods.
the problem is what b.php itself detects as referer...
when you do header Location redirect, REFERER field is blank, and i want it to appear as if user has clicked a link to go to b.php
the problem is what b.php itself detects as referer...
when you do header Location redirect, REFERER field is blank, and i want it to appear as if user has clicked a link to go to b.php
The answer: No. Not possible.hookgr wrote:i dont mean how i can pass between the two scripts the variable referer or the data, i know about sessions and lot other methods.
the problem is what b.php itself detects as referer...
when you do header Location redirect, REFERER field is blank, and i want it to appear as if user has clicked a link to go to b.php
astions has provided you with alternatives, if they are not good enough, then what you seek is not possible.