www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to make a script pause?

  1. #1
    Join Date
    Nov 2013
    Posts
    72

    How to make a script pause?

    I need part of a script to display a message, pause for a few seconds so the user can see it, and reset the string to empty so that message disappears. I tried using the sleep function but it does not seem to work for some reason. Am I doing something wrong or is there a better way to do it?

    PHP Code:
    $message "Thank you";
    sleep(5);
    $message ""

  2. #2
    Join Date
    Mar 2011
    Posts
    1,160
    You can't do that with PHP. You need to use JavaScript to change the content of a page after it's been sent to the user. PHP generates the page (once!), sends it to the user, and that's all.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles