CrazyEngineers
  • I need a simple php code for the below query

    sravan18

    sravan18

    @sravan18-pXObZH
    Updated: Oct 25, 2024
    Views: 1.1K
    Create browsing history page of website. When user browse through pages of website at the end user can see which pages he browsed.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorNov 12, 2012

    sravan18
    Create browsing history page of website. When user browse through pages of website at the end user can see which pages he browsed.
    Not getting a clear idea of this. You want a PHP page that keeps track of which pages a user has visited - is that right? So I'm guessing -

    1. User visits page 3-5-9 on example.com
    2. A page on example.com/history.php keeps track of which pages were browsed by the user

    Or do you want something similar to what Google Analytics does - embeds javascript at the bottom of every page and keeps track of who's visiting what?
    Are you sure? This action cannot be undone.
    Cancel
  • sravan18

    MemberNov 12, 2012

    Yes, I need a PHP page that keeps track of which pages a user has visited. Could you help me out with this.
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberNov 24, 2012

    its simple

    create a table named history with 3 cols, id, page, datetime, session id in mysql or whatever db you want to use

    now create a function in header of your php file (this file must be included on all web pages)
    Now when ever user visits any page , simply put an entry to this table,

    If you want then you can add one more col named count, that will increment if user tries to view same page again

    Let me know if any doubts
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register