PDA

View Full Version : Control Access By Time??



bcw757
06-25-2005, 05:10 PM
Is there a script, that will look to see what time it is on the server, and at a certain time, use one set of code, and at another time use another set of code?

Example. Because our center is not open 24 hours a day, on my webcam pages, it would be cool if I could get them to display,

Sorry We're Closed

Instead of pulling up the JavaClient for the webcam. I know this is beyond tech support, was just wondering if there was a way...

bcw757
06-25-2005, 09:00 PM
Figured this out if anyone wants to know.

Make sure you are creating a .php page with BVoda


<?php
// Get Time
$now = localtime(time(), 1); ?>

<?php
// Check if current hour is between 23:00 (11:00 PM) and 10:59 AM

if ((intval($now['tm_hour']) > 22) || (intval($now['tm_hour']) < 11)) {
// Output is Closed
echo '<center> <FONT style="FONT-SIZE:12pt" color="#FF0000" face="Arial"><B>WebCam Operates Only Between the hours of<br>11am - 11pm est</B></FONT> </center>';



}
else {
// Output Webcam
echo

'<*****T CODE="SimpleCam*****t2.class" CODEBASE="local IP:8080/" WIDTH="320" HEIGHT="240">

<PARAM NAME="SERVER" VALUE="Local IP Address">

<PARAM NAME="PORT" VALUE="8080">

<PARAM NAME="URI" VALUE="/video">

</*****T>';

} ?>

VodaHost
06-25-2005, 10:37 PM
well done