php session tracking and MySQL?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am a php newbie. I would like to count how many times a user visit a
I know session tracking should be used, but where i put the code? Is it
inside the html that the user visit?

    if (!IsSet($page_number))
       $page_number = 1;
    print("You have now visited $page_number");
    print(" of pages <br />");

Also, i want to record the number of time a user visit a page and store
it in MySQL. I know how to do it using  "form action and submit" way,
have no clue of doing it with session tracking .

Re: php session tracking and MySQL?

On 30 May 2005 09:34:29 -0700 (more or less), wrote:

Quoted text here. Click to load it

You can't do what you want with session cookes. You'll need to create a
permanent (or at least long duration) cookie for a visitor.

Something like:

   // look for an existing cookie for this site
   if (isset($_COOKIE['$thispage'])) {    // if found, increment the count in
the database

  // set a cookie (or extend the life of the current one


Site Timeline