Jump to content

how to wait for only 6 hrs to reply for the challenge


TheFreak

Recommended Posts

Save the start time in the database, then check the submitted response time against the start time... if it is longer than six hours, give them the wha wha whaaaaaa(Prices Right sound effects) and deny them. If not, challenge complete :)

Save the start time in the database, then check the submitted response time against the start time... if it is longer than six hours, give them the wha wha whaaaaaa(Prices Right sound effects) and deny them. If not, challenge complete :)

 

In addition, you can combine this with mikefrederick's suggestion and auto-fail them at 6 hours by running a cron job every minute (or five, or ten) that checks for expired challenges.

 

The nice thing is that it can all be done with one query:

SELECT * FROM challenges WHERE submission_time < CURTIME() - INTERVAL 6 HOUR;

 

That returns all expired (older than 6 hours) challenges. You could even have an expired column where you can update them all in one query, too:

UPDATE challenges SET expired = 1 WHERE submission_time < CURTIME() - INTERVAL 6 HOUR;

use a cron job

 

i don't know about it.

 

Quote from: MatthewJ on Today at 12:13:29 PM

Save the start time in the database, then check the submitted response time against the start time... if it is longer than six hours, give them the wha wha whaaaaaa(Prices Right sound effects) and deny them. If not, challenge complete Smiley

 

In addition, you can combine this with mikefrederick's suggestion and auto-fail them at 6 hours by running a cron job every minute (or five, or ten) that checks for expired challenges.

 

I was more into showing the user how much time is left,don't want to use ajax but a simple php time clock types.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.