#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    20
    Rep Power
    0
    I need to be able to track visitor over domains. The reason being that it is an educational project and they get funded on how much time visitors spend viewing resourses,(wish I did)on their site and a few other co-operating domains.
    I know the rudements of cookies and I am a newbie at PHP/MYSQL although I have managed to set up the database and search it ect.
    The other domains would be fully co-operative.

    I would be grateful for any advice as to how I could achieve this using PHP/MSQL and Cookies or whether anyone has had experience of doing something similar.

    Thank you in advance..............
  2. #2
  3. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    I posted a question similar to this here not too long back...

    My reasons for this was somewhat different, but I'd imagine the approach would be the same... so here's what I had planned, which btw didn't really involve much in the way of "cookie" use.

    On the project I'm working on, we will have 'registered' users/members. We wanted to track on a similar basis.

    SO I had planned on storing the "time-in" and "time-out" along with other information in a database table... such as the username, etc..

    A rather simple thing to do really, since we're talking PHP.. when the browser calls the page, you can grab some information about your visitor, like the agent, ip, etc..

    Then record it in a database table, as the page is being loaded...

    My only delimma is this.. recording the 'time-out'.. thinking about those little quirks that occur from time to time..

    browser crashes, etc.. which I haven't decided how best to handle.

    Naturally in a site where the person has to login/logout, you can use that to your advantage, and for when the visitor leaves the site, you could probably get by with using an "onexit" function, that calls the scripting for the time-out.

    on an "onclose" for when the user closes the window.

    These are just my thoughts at the moment, as I haven't tested these approaches.

    One might even use a SESSION cookie.. PHP Sessions could probably be the best solution...

    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Robert_J_Sherman:

    My only delimma is this.. recording the 'time-out'.. thinking about those little quirks that occur from time to time..

    browser crashes, etc.. which I haven't decided how best to handle.
    [/quote]

    Unfortunately there is no way for server to determine whether client is still reading the page or their browser crashed already, or they just forgot to close the window before going home. The only solution is setting reasonable timeout, say 20 mins, after which the server will record "user logged out" event in the database, if no other event such as "new page loaded" or "client closed the page" has happened during the timeout.
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    20
    Rep Power
    0
    Thanks for your advice.
    This is Voodoo but cool Voodoo none the less.
    If I can get this to work I will let you know.

Similar Threads

  1. php/mysql Developer needed for online game
    By Lord Melo in forum Project Help Wanted
    Replies: 1
    Last Post: October 29th, 2003, 09:15 PM
  2. PHP/MySQL Application Design/Architecture Books
    By glambert in forum PHP Development
    Replies: 7
    Last Post: April 10th, 2003, 09:52 PM
  3. PHP/MySQL Issues... Please help.
    By misteraven in forum PHP Development
    Replies: 14
    Last Post: August 7th, 2002, 08:03 PM
  4. PHP/MySQL Backend
    By Cujo in forum PHP Development
    Replies: 4
    Last Post: May 15th, 2002, 08:00 PM
  5. need open source call tracking software
    By nancy in forum PHP Development
    Replies: 3
    Last Post: May 3rd, 2002, 03:52 AM

IMN logo majestic logo threadwatch logo seochat tools logo