Page 1 of 1

Lock page with timer

Posted: Thu Mar 15, 2012 11:52 am
by timerlock
What is the easiest way to lock a page with a 30 second timer so that the visitor cannot click "Continue" until the 2 minute timer has counted down, similar to the way some forums have those 30 second times there make the visitor wait 30 seconds before click the "I agree" button to continue to the forum?

Is there a plugin or something? A script maybe? Or is the code small and easy to throw on a basic html page? It's just for a basic intro page to my site so that the visitor cannot click "Enter" until 30 seconds, which is enough time for them to read the rules/announcement on the intro page.

Anyone know? I searched everywhere on google and cannot find a script or plugin that does it.

Re: Lock page with timer

Posted: Thu Mar 15, 2012 1:06 pm
by califdon
Nothing you can do in PHP, but you could write Javascript code to only activate the link after a delay. I'll move this topic to our Javascript forum.

Re: Lock page with timer

Posted: Thu Mar 15, 2012 10:34 pm
by requinix
FWIW, if I ever found a forum like that then I would just walk away from it. Wouldn't give it a second thought. And if it was bothersome enough I'd block its results from Google (like I do Expert Sex Change) so I wouldn't have to think about it a first time ever again.

But it's not my forum. You can use setTimeout() to wait the amount of time, but after that it depends what the disabled link looks like. Disabled button? No link at all? Looks like a link but doesn't work?

Re: Lock page with timer

Posted: Thu Mar 15, 2012 11:57 pm
by Weiry
JavaScript is inherently problematic as anyone can simply run a browser with JS disabled, which means you need to start implementing <noscript> tags etc.
Not to mention that anyone who knows how to do JavaScript injection could change your timer anyways.

But as requinix said:
requinix wrote:if I ever found a forum like that then I would just walk away from it. Wouldn't give it a second thought.