1

I am currently using;

header('Location: '. $_SERVER['HTTP_REFERER']) ;

Is there a way of directing to the bottom of this page, as opposed to referring back to the top?

random_user_name
  • 25,694
  • 7
  • 76
  • 115
Braydos1986
  • 101
  • 6
  • 4
    1, no, 2 HTTP_REFERER is completely unreliable –  Mar 18 '14 at 19:54
  • 2
    `Location: http://example.com/oldpage.html#anchor_at_bottom_of_page`, but as Dagon said, the referer is UTTERLY unreliable. – Marc B Mar 18 '14 at 19:55
  • Storing the previous page in a session or using js seems infinitely more up to the task indeed. – Wrikken Mar 18 '14 at 19:59
  • One has to wonder why it still even exists (`$_SERVER['HTTP_REFERER']`) and why they came up with it in the first place. BIG QUESTION MARK. – Funk Forty Niner Mar 18 '14 at 20:01

1 Answers1

0

Don't rely on server-side client details. Instead, you can try using JS. See: Can I detect when a user gets to a page using the back button? for more info.

Community
  • 1
  • 1
Rob W
  • 9,134
  • 1
  • 30
  • 50