Is there any type of criteria that would point a user to directoryA or
directoryB?

 I recently rebuilt a site that handled a couple thousand
different working directories for clients but used only one set of
scripts for all. The user would have to login and variables were pulled
from a database to set the directory that they would work in. The
directory name could be passed from script to script or stored in
sessions.

Ed



On Thu, 11 Sep 2003, Juan Nin wrote:

> Hi!!!
>
> I´m programming a site in PHP, where I want to do the following:
>
> I will have a set of different directories, where each directory must
> execute the same PHP pages, but giving as result different data,
> according to the directory where you are located (obtained by
> $_SERVER[´PHP_SELF´] for example).
>
> For example I have:
>
> http://www.domain.com/directoryA/
> http://www.doamin.com/directoryB/
>
> So each one must have (or should act as if they had) the same PHP pages
> and directories under them.
>
> The solution I thought, as copying each page in every directory makes no
> sense (if I modify the code I´ll have to change all the pages in all
> directories), is to have an includes directory. where I put all the PHP
> pages, and in each of the different directories I create pages that
> simply include or require the ones from the include directories.
>
> That way I´ll only modify code inone place..
>
> Now.. is there any better way to achieve this??
> I thought that maybe with some Apache stuff, but I don´t think there¶
> something that will help, since directives such as RedirectMatch, etc.
> rewrite the URL, and I don´t want that, I want the URL to remain
> http://www.domain.com/directoryX/whatever.php
>
> Is there any way to do this, or I should stick up with the includes??
>
> Thnx in advance,
>
> Juan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to