Help.. Countdown time the redirect

Discussion in 'PHP' started by strikerjamie, Oct 20, 2008.

  1. #1
    Hi Guys,
    I am new to PHP and im wondering if you could help me?

    I am after a count down timer that will redirect the user to a page once the count down has finished.

    example: The user has 10 days to user a certain page and once the 10 days are finished, if they try to load the page again it will redirect them to somewhere else...

    I hope my description was clear... Any help would be great :)
     
    strikerjamie, Oct 20, 2008 IP
  2. skateme

    skateme Peon

    Messages:
    162
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll have to use a database like MySQL if you want the countdown to continue in case the user closes the page. Make one table with one column, a timestamp. When the user refreshes the page, check to see if 10 days have passed since the day was inserted into the database. If 10 days haven't passed, subtract the current time from the timestamp, subtract that from 10, and display the results. Hope that wasn't too confusing. Since you are new to PHP, then you should first cover the basics of databases and MySQL before trying this :)
     
    skateme, Oct 20, 2008 IP
  3. rhoula

    rhoula Well-Known Member

    Messages:
    875
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    145
    #3
    There are few ways to do it but first you neeed to spesify if you will have a registration page that way the access to the page wil be password protected and once the page is viewed the first time the countdown will start.
    If you send more information I may be able to help you.
    Have a great day
     
    rhoula, Oct 20, 2008 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    once registered, insert the user time in the database and the unix time or the server time will monitor it...

    sample

    in the database time of registration 05-08-1985 13:04:40
    while in the unix time or server time or database time 05-13-1985 14:06:50
    just the logic of
    if the registration time minus(-) the current time is not equal or greater than 10 days then the session is true
     
    bartolay13, Oct 20, 2008 IP
  5. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #5
    and about your countdown, js or ajax can do it, based on the results in the equation i given you will start your timer to the time before the session comes in 10 days..
     
    bartolay13, Oct 20, 2008 IP