-2

Possible Duplicate:
Countdown timer built on PHP and jQuery?

I need create a 30 min count down timer and to display message box after 30 min over

6
  • This is probably better implemented on the client-side via JavaScript. Commented Jul 28, 2012 at 12:12
  • Think you are searching for an ajax solution (jquery / javascript +php file) Commented Jul 28, 2012 at 12:13
  • 1
    Have you attempted anything yourself, or are you looking for a complete solution? You need to at least try doing this yourself. Commented Jul 28, 2012 at 12:13
  • What you are looking for is an AJAX countdownlike mentioned here: stackoverflow.com/questions/7115620/… Commented Jul 28, 2012 at 12:14
  • Try out github.com/vkiryukhin/Smartupdater =) Should be very easy Commented Jul 28, 2012 at 12:18

1 Answer 1

2

You can't do it directly in PHP as PHP is run on the server.

You could pop out some javascript that runs a countdown timer - you can google for a bucket of tutorials on that.

You could however possibly insert a row into a database with the start time and check it on a regular basis as scripts run - then display it one the next page that is loaded after the time has expired.

Edit: As Daniel correctly points out in the comment below (+1 btw) you could have a PHP file called by javascript that checks the database and pops out your message when the timer has expired.

Sign up to request clarification or add additional context in comments.

1 Comment

should be .load() or .get() or the .ajax() function or jquery

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.