SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Balto, MD
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tracking User Visits

    Wow, I have learned a ton about PHP, MySQL and programming in the past couple of months. Thanks first to everyone here.

    Now, though I am stuck on the following problem:

    Upon the first visit of a visitor to my site, I record some basic information such as IP used, and name, and the date and time.

    I set $date=date("Y-m-d H:i:s");

    I want to update user information based on ip number used only if connections occur more than fifteen minutes apart.

    I can retrieve the most recent connect date from the database correctly, and can update the connect date if the stored date is less than the current date. However, I don't know how to get the 15 minute interval coded.

    In other words, I only want to update if the (stored date and time +15 minutes) is less than the current date and time.

    How can I do this?
    ---***---***---
    Good Programming takes a long time and costs a lot of money.

    Bad programming is done by the hour and costs minimum wage.

  2. #2
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a cookie that expires in 15 minutes.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Balto, MD
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Though setting a cookie is an obvious answer and probably is simplest, too many people disable them for various reasons...

    Perhaps I should look at using timestamp instead and setting the threshold at timestamp + 54000 seconds.
    ---***---***---
    Good Programming takes a long time and costs a lot of money.

    Bad programming is done by the hour and costs minimum wage.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •