PHP get browser history

Posted on 2007-07-25
Last Modified: 2013-12-13
Hi All,

Is there a way to find out what the previous page a user was on within PHP?


Question by:detox1978
    LVL 24

    Accepted Solution

    You can check the value of $_SERVER['HTTP_REFERER']. Please note that this information is not set by all browsers, and will only be set if a person clicks a link to get to your page (rather than by entering your URL directly).
    LVL 24

    Expert Comment

    If the previous page was on your site, you can also track a user's session. For example, you can create a database entry each time the user visits a new page on your site, or you can track the entire list within the $_SESSION array itself.

    Featured Post

    Easy Project Management (No User Manual Required)

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now