Re: htaccess question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 11, 2009 at 4:46 PM, tedd <tedd@xxxxxxxxxxxx> wrote:

> 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.
>
> Here is a link to the manual.

http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

*PHP_INI_PERDIR* Entry can be set in php.ini, .htaccess or httpd.conf

Opinions and suggestions welcomed.
>
> Thanks,
>
> tedd
> --
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux