Wait 3 seconds after click

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SuperX
Forum Newbie
Posts: 3
Joined: Sun Apr 09, 2006 5:56 pm

Wait 3 seconds after click

Post by SuperX »

How do I let a user click on link and wait for like 3 seconds to run php code on same page?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Do you want it to wait on the page or make the request to look like it's taking three seconds? The former is Javascript (setTimeout) the latter is sleep()
SuperX
Forum Newbie
Posts: 3
Joined: Sun Apr 09, 2006 5:56 pm

Post by SuperX »

Ah, that what I am looking for! Thanks! :D I test it out and it work, but not what I thought what I need. I was try to do same thing like at Megaupload.com... for example, when user wait for timer finish and click on link and it popunder then wait like 3 seconds then it run php page. I think it have to do before php page run. Maybe html, css, or something.
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Code: Select all

<?php

// Code goes here

if (sleep(3)){
include('download.php');
}
?>
Post Reply