Announcement

Collapse
No announcement yet.

Control Access By Time??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Control Access By Time??

    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...

  • #2
    Figured this out if anyone wants to know.

    Make sure you are creating a .php page with BVoda

    Code:
    <?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>';
    
    } ?>

    Comment


    • #3
      well done

      VodaHost

      Your Website People!
      1-302-283-3777 North America / International
      02036089024 / United Kingdom
      291916438 / Australia

      ------------------------

      Top 3 Best Sellers

      Web Hosting - Unlimited disk space & bandwidth.

      Reseller Hosting - Start your own web hosting business.

      Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


      Comment

      Working...
      X