Re: run a script for any HTTP request (was: run a script on access to a directory)

From: Date: Fri, 07 Sep 2001 21:15:52 +0000
Subject: Re: run a script for any HTTP request (was: run a script on access to a directory)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66476@lists.php.net to get a copy of this message
What's wrong with rewriting urls? The other alternative is to make sure that none of the urls you are accessing actually exist and then setup an ErrorDocument handler which calls the php script of your choice... which can then do whatever you want... -philip On Fri, 7 Sep 2001, Enrique Vadillo wrote: > That was a fine idea Doug, but what if we push the subject and > go a little further? > > I am thinking now that i'd like to make it possible that for > ANY http request received by my Apache i'd like to have a php > script executed first, i.e.: > > http://domain.com/ > http://domain.com/anydir/anyfile > > for any of those locations typed, i'd like to be able to > execute the php script. i know it's kinda weird but this is > what i'm really looking for. any ideas anyone? > > Enrique- > > >From: "Doug Granzow" <dig@cynosure.net> > >To: php-general@lists.php.net > >Subject: Re: execute a script on access to a directory > >Date: Fri, 7 Sep 2001 15:38:45 -0400 > > > >You can make "go" the name of your PHP script, then put this in your Apache > >config: > > > ><Location /go> > > ForceType application/x-httpd-php > ></Location> > > > >Now in your "go" script, you have it do whatever you wanted it to do, then > >use an include to load the "getit" script. > > > >Doug Granzow > >dig@cynosure.net > > > ><enrique_vadillo@hotmail.com> wrote: > > > Hi, > > > > > > I would like to know how i can force a PHP script to be > > > executed everytime a certain directory is accessed, for > > > example in http://domain.com/go/getit the presence of > > > the > > > /go/ directory would force a PHP script to be executed > > > prior to any operation. > > > > > > Do i need to play with rewriting urls in Apache or is > > > there any other cleaner method (that would not require > > > rewriting URLs) to achieve this? i'd hate to have to > > > rewrite URLs... > > > > > > thanks. > > > _________________________________________________________________ > Descargue GRATUITAMENTE MSN Explorer en > http://explorer.msn.es/intl.asp > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#66476) next »