htaccess question

From: Date: Fri, 11 Sep 2009 14:46:41 +0000
Subject: htaccess question
Groups: php.general 
Request: Send a blank email to php-general+get-297905@lists.php.net to get a copy of this message
Hi gang: Is there a way I can use a htaccess directive to require a php script to be "included" within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an authorization script before executing. The hard way is for me to go through each of the 100 scripts and add the statement "require(auth.php)", but I don't want to do that (I'm too lazy and beside there is too great of a chance of an error). So, is there a way for me to circumvent this problem by using a htaccess directive? Now, I know that I can use htaccess to require basic authorization, like so: AuthType Basic AuthName "admin" AuthUserFile /home/httpd/vhosts/mydomain.com/.htpass require valid-user But I don't want a file containing user ids and encrypted passwords in the file system. Instead, I want to move the user ids and passwords into the database and out of the file system. I can do this with an authorization script, but I don't want to alter 100 scripts to do it. Opinions and suggestions welcomed. Thanks, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#297905) next »