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
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
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
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
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..