p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: ch 13 pg 478 access_logger.php


Message #1 by "andrew waterz" <andrew@e...> on Mon, 25 Feb 2002 23:23:22
i set auto_prepend_file in my php.ini to access_logger.php but none of my 

pages are prompting for authorization, anyone have the same problem???
Message #2 by sibermel@y... on Tue, 26 Feb 2002 09:19:14
I did have problem for the access_logger.php file too.



for the array files, like the below:



$exclude_files = array("index.php", "about.php", "other_files_here.php");



...

...



$filepath = dirname($PHP_SELF);

$filename = basename($PHP_SELF);



if($filepath == '') $filepath = '/';



$auth_done = 0;



for($j=0; $j < count($exclude_dirs); $j++) {

   if($exclude_dirs[$j] == $filepath) break;

   else {

      for($i=0; $i< count($exclude_files); $i++) {

         if($exclude_files[$i] == $filename) break;

         else {

            session_start();

            do_authentication();

            $auth_done = 1;

            break;

         }

      }

   }

   if($auth_done) break;

}







accoding to the book, when the protected script/file filename is either 

index.php, about.php or other_files_here.php, the said file shoudl be 

excluded from being protected or the users can access the said file 

without the need to login.



BUT, I tried many times and checked my script many times (it is correctly 

written), the $exclude_files array only works with the first filename, 

which is index.php.  Can anyone help me to solve this problem.



My OS is W2000 Professional.

  Return to Index