Просмотр файла simple_page_protect/simple_page_protect.php

Размер файла: 1.76Kb
  1. <?php
  2. /******************************************************************************\
  3. * Simple Page Protect Version 1.0 *
  4. * Copyright 2000 Frederic TYNDIUK (FTLS) All Rights Reserved. *
  5. * E-Mail: tyndiuk@ftls.org Script License: GPL *
  6. * Created 02/28/2000 Last Modified 02/28/2000 *
  7. * Scripts Archive at: http://www.ftls.org/php/ *
  8. *******************************************************************************/
  9. /*******************************************************************************/
  10. // Necessary Variables:
  11.  
  12. $LOGIN = "ftls";
  13. $PASSWORD = "demo";
  14. // En: login /password
  15. // Fr: login / mots de passe
  16.  
  17. // End Necessary Variables section
  18. /******************************************************************************/
  19.  
  20. function error ($error_message) {
  21. echo $error_message."<BR>";
  22. exit;
  23. }
  24.  
  25. if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $LOGIN) && ( $PHP_AUTH_PW == "$PASSWORD" )) ) {
  26. header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
  27. header("HTTP/1.0 401 Unauthorized");
  28. error("Unauthorized access...");
  29. }
  30. ?>
  31.  
  32. <!-- Add code of your web page here -->
  33. <HTML><HEAD><TITLE>Your protected page</TITLE></HEAD>
  34. <BODY BGCOLOR="white">
  35. <BR><BR><P ALIGN="Center"><FONT FACE="Arial, helvetica" SIZE="+2" COLOR="#336699"><STRONG><EM>Your protected page</EM></STRONG></FONT></P><BR>
  36.  
  37. <BR><BR><BR><BR><BR><BR><BR><BR>
  38.  
  39. <CENTER><BR><BR>
  40. <FONT FACE="Arial" SIZE=-2>
  41. <EM>&copy Copyright 2000 <A HREF="http://www.ftls.org/">FTLS</A> (Tyndiuk Fr&eacute;d&eacute;ric). All rights reserved.
  42. <BR>FTLS's PHP Scripts Archive : <A HREF="http://www.ftls.org/php/">http://www.ftls.org/php/</A></EM></FONT>
  43. </CENTER></BODY></HTML>