You can make "go" the name of your PHP script, then put this in your Apache

<Location /go>
    ForceType application/x-httpd-php

Now in your "go" script, you have it do whatever you wanted it to do, then
use an include to load the "getit" script.

Here's an except from my equivalent of your 'go' script:

    // $PATH_INFO = the rest of the URI after dmb/
    // (in "";)

    // remove anything other than letters, numbers, dots, underscores,
    // and dashes, and put into an array

    // for example "trading/toptraders" will be an array consisting
    // of "trading" ($args[1]) and "toptraders" ($args[2]).  The / is

    ereg("(^[-_.\/a-zA-Z0-9]*$)", $PATH_INFO, $arg);

    $args = split( "/", $arg[1]);
    $file = "include/" . $args[1] . ".inc";
    if (file_exists($file)) {
      include "$file";
    } else {
      404 not found

Note the line that sets the value of $file.  In this case, your 'getit'
script is in the "include" directory, not the "go" directory.  (You can't
have a directory named 'go' since you now have a script named 'go'.)

Doug Granzow

"Enrique Vadillo" <[EMAIL PROTECTED]> wrote in message
> 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 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.
> Enrique-
> _________________________________________________________________
> Descargue GRATUITAMENTE MSN Explorer en

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to