Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Allow Page at a specific time interval daily

Please Help

   
7:57 pm on Aug 3, 2009 (gmt 0)

5+ Year Member



Hi, I am still learning my first steps in web development, and here is what I need.
I need a web page to be only available at a specific time interval daily, for example starting from 10.00 am to 10.15.
If the visitor tried to access this page at any other time a message appear to him to inform him that this is not the allowed time for this action or he could be directed to another page.
I need this function to be secure as much as possible, but again I am a beginner so if this security will need some complicated scripting or advanced server features or languages, then a less secure option can be accepted.

Thanks in advance for everyone who will try to help.

8:07 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have an answer for you, but is that the server time or the user time. Are all your users in the same time zone?

Welcome to WebmasterWorld

8:17 pm on Aug 3, 2009 (gmt 0)

5+ Year Member



Thanks for your fast response,
It can be either the Sever time or User time, this doesn't cause a problem for me, All users are in the same time zone "GMT+2.00"
9:08 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Again I have not tried this, but searching on (.htaccess time) there are some simple time redirects that you can use.
9:51 pm on Aug 3, 2009 (gmt 0)

5+ Year Member



I have been searching and wasn't able to reach anything regarding .htaccess, but through my search I found this link, I think this explains what I need, but I am looking for some free script.
[modules.alldnnskins.com...]
10:27 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this [unixcities.com] I searched on .htaccess time
6:40 am on Aug 4, 2009 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can use PHP if you want to. Create your page with the .php extension, then add a time check.

$start = '10:00';
$stop = '10:15';

<?php
if (date('h:i')>=$start && date('h:i')<=$stop) {
// You can`t view this page..
} else {
// Ok, add relevant code here..
}
?>

dc

8:51 am on Aug 4, 2009 (gmt 0)

WebmasterWorld Senior Member piatkow is a WebmasterWorld Top Contributor of All Time 5+ Year Member



If you are using server time take account not only of the server's time zone but also, if it is in a different country, when daylight saving starts and ends.


All users are in the same time zone

That assumes that their PCs are running with the correct date/time.