Page 1 of 1

how to display the text for a particular duration of time

Posted: Fri Sep 13, 2013 12:14 am
by samir_gambler
Hello,
I am new to web development and I am trying to develop on-line exam practice website. I need to display a question for a particular duration of time and after that next question should be displayed and so on. Can any one please help me how to achieve this.

Thanks & Regards,
Samir

Re: how to display the text for a particular duration of tim

Posted: Fri Sep 13, 2013 12:25 am
by pbs
first use AJAX and then using javascript setInterval() function you can change the question in some time interval

Re: how to display the text for a particular duration of tim

Posted: Fri Sep 20, 2013 5:00 am
by priyankagound
You will want to modify your WordPress theme so that the changes can be site-wide.

Log in to your WordPress installation.
Navigate to Appearance > Editor
In the Templates section, go to header.php
At the very beginning of header.php, insert your code :
<?php
$date = time();

$contestStart = strtotime('2012-02-03 00:00:00');

if ($date < $contestStart) {
?>

<html>
Insert your whole splash page here.
</html>

<?php
exit;
}
?>
//The normal template code should be below here.
Don't forget to click the "Update File" button on WordPress when you're done; and like the others said, make sure that your specified time is synced with whatever timezone the server is in.

Re: how to display the text for a particular duration of tim

Posted: Tue Sep 24, 2013 4:40 am
by priyankagound
Try out this.

if you need to display the link between 11:45pm and 11:59pm on Sunday, you could do something simpler:

For example:

if ($d == 'Sunday' && $h == 23 && $m >= 45 && $m <= 59) {
$ucrTimeToggle = 'radio-online';
} else {
$ucrTimeToggle = 'radio-offline';
}