SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up automatically runable script

    hi
    i m developing a site in which i m giving users some points which are to be expired after thier expiry period.now i want to make a script which should run automatically after each minute and checks the users point's expirydate and makes the points '0' if expirytime is reached.

    can any body help me that how can i make automatically run and give me code.
    its urgent plzzz.....
    regards
    phphelp

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum. See Where should I post my thread? for details

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Addict melchiorus's Avatar
    Join Date
    Jun 2004
    Location
    Indiana
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest way is to make a PHP script to run any SQL queries or what have you and then use a cron job to call this file.

    Please note, though, that running it every minute could possibly hurt your server's performance, so use it with care.
    -Melchior (Stephen Craton)

  4. #4
    SitePoint Evangelist dmsuperman's Avatar
    Join Date
    Feb 2005
    Location
    A box
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about storing the time to start the expiration with the user and the time that it lasts, then when they run it themselves it compares the time that it's supposed to end with the current time, and if it comes up that the current time is > stored time + time limit then change a setting saying that it expired.
    <(^.^<) \(^.^\) (^.^) (/^.^)/ (>^.^)>
    Core 2 Duo E8400 clocked @ 3.375GHz, 2x2GB 800MHz DDR2 RAM
    5x SATA drives totalling 2.5TB, 7900GS KO, 6600GT


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
  •