Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:21:18+00:00 2026-06-04T18:21:18+00:00

i found this question on quora and didn’t know how to resolve it Scenario

  • 0

i found this question on quora and didn’t know how to resolve it

Scenario —

User is on one.php and clicks a link that points to two.php

Two.php does a header redirect to three.php

If we check the referring URL on three.php $_SERVER shows one.php instead of two.php

How do we find out that two.php was an intermediate page that did a header redirect?

Note that I can not do anything with one.php or two.php that can include any params saying two.php included in the redirect

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:21:19+00:00Added an answer on June 4, 2026 at 6:21 pm

    Save the Record with Sessions

    You can save the stack on a session variable. Just keep unshifting values onto $_SESSION["history"], removing items from the end of the array when the collection grows to a certain size.

    For instance:

    // Need to do this if we wish to store data
    session_start();
    
    // Set the history array if it doesn't exist
    isset( $_SESSION["history"] ) || $_SESSION["history"] = array();
    
    // Push current URI onto history
    array_unshift( $_SESSION["history"], $_SERVER["REQUEST_URI"] );
    
    // Prevent history from exceeding 5 values
    array_splice( $_SESSION["history"], 5 );
    

    Load it into all PHP files

    This would need to be added to the top of each file, or to a global header template include if you have one. Alternatively, if you dare, you could load it globally using auto_prepend_file:

    Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require function, so include_path is used. – Documentation

    Inspect the History

    You could show the entire history by accessing $_SESSION["history"]:

    // Output history array
    var_dump( $_SESSION["history"] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this question that had been answered, but it didn't solve my problem:
Found this question that explained a way to communicate between layers. However there is
I found this question that is discussing what I would like to do, but
I found this question that was very useful in learning the basics of the
While I found this question being answered here on SW several times, I didn't
I have found this question in the one site which was about counting sort
I found this question which is the same problem that I would like to
I found this question in one of my previous exam papers and I am
I found this question, which is similar to a problem that I would like
I've found this question on hubFS, but that handles a splitting criteria based on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.