<?php
$strDate = (strftime ("%A, %e %B %Y"));
if (!isset($PHP_AUTH_USER) && !isset($PHP_AUTH_PW))
     {
     header("WWW-Authenticate: Basic realm=\"Shockwave Password Protected Directory\"");
     Header("HTTP/1.0 401 Unauthorized");
    echo "<HTML><BODY BGCOLOR=000066 LINK=ffcc00 VLINK=ffcc00 ALINK=ffcc00>
    <DIV ALIGN=center>
    <FONT FACE=arial,verdana SIZE=3 COLOR=ffffff>
    <B>You must have a username and password to enter this page in
    <BR><BR><font size=6><A HREF=\"http://$SERVER_NAME\">$SERVER_NAME</a><B></FONT>
    <BR><BR>Your ip was logged as 
    <BR><FONT COLOR=ffcc00>$REMOTE_ADDR</FONT>
    <BR>Date of attempted entry 
    <BR><FONT COLOR=ffcc00>".$strDate."</FONT>
    <BR>If you feel this is an error please contact 
    <BR><A HREF=\"mailto:$SERVER_ADMIN\">$SERVER_ADMIN</A>
    <BR><BR>Back to <A HREF=\"$HTTP_REFERER\">$HTTP_REFERER</A>";
     exit;
     }    
  else if(($PHP_AUTH_USER=="adm") && ($PHP_AUTH_PW=="adm"))
  {
  


// directory to index
//include ('index.php?topic=home.php');

// If no topic selected, display the default content.
  IF ($topic == '') :
  // table_top ("<br><br>Welcome Webmaster<br><br>");
  include("./home.php");
  // table_bottom ();
  ELSE :
  // table_top ("$topic");
   INCLUDE "$topic";
  // table_bottom ();
  ENDIF;

}

else
{
header("WWW-Authenticate: Basic realm=\"Shockwave User Authentucation Required\"");
Header("HTTP/1.0 401 Unauthorized");
    echo "<HTML><BODY BGCOLOR=000066 LINK=ffcc00 VLINK=ffcc00 ALINK=ffcc00>
    <DIV ALIGN=center>
        <DIV ALIGN=center>
    <FONT FACE=arial,verdana SIZE=3 COLOR=ffffff>
    <B>You must have access to view this page in
    <BR><BR><font size=6><A HREF=\"http://$SERVER_NAME\">$SERVER_NAME</a><B></FONT>
    <BR><BR>Your ip was logged as 
    <BR><FONT COLOR=ffcc00>$REMOTE_ADDR</FONT>
    <BR>Date of attempted entry 
    <BR><FONT COLOR=ffcc00>".$strDate."</FONT>
    <BR>If you feel this is an error please contact 
    <BR><A HREF=\"mailto:$SERVER_ADMIN\">$SERVER_ADMIN</A>
    <BR><BR>Back to <A HREF=\"$HTTP_REFERER\">$HTTP_REFERER</A>";

}

?>

</BODY>

</HTML>
