Results 1 to 2 of 2

Thread: PHP time filter

  1. #1
    Member
    Join Date
    Apr 2001
    Location
    England
    Posts
    115

    PHP time filter

    Hi,

    The school that I work at wants to prevent students from looking at our internal photo galleries during lession time, so I've been asked to restrict the times users can access certain pages on our Intranet.

    I'm using;

    Code:
    <?php
    $greenwich = (int) gmdate('Gi');
    if (($greenwich >= 0100) and ($greenwich <= 0855)) {
    header('Location: http://intranet/images/photogalleries/wexp2005DnD/default89.htm');
    } else {
    header('Location: http://intranet/images/photogalleries/wexp2005DnD/time.htm');
    }
    ?>
    I'm not that falimiar with PHP, so have been using multiple single files to filter access for different times of day. Is there any way of using a single PHP file to filter page access at different times of day?

    The other problem is that I can't get this to allow students to access the restricted pages. It doesn't like times before 1000, so the example above always sends them to the time.htm file (a note telling them that it is the wring time of day to access the pages.)

  2. #2
    Member
    Join Date
    Apr 2001
    Location
    England
    Posts
    115
    I think I've got it sorted..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •