[thelist] PHP Functions

Jack Timmons jorachim at gmail.com
Tue Dec 30 06:13:24 CST 2008


On Tue, Dec 30, 2008 at 3:36 AM, Santilal Parbhu <santilal at scorpioneng.co.nz
> wrote:

> Hi
>
> I am developing a site where there are multiple users.  For convenience I
> have assembled the site so that the scripts used for each user are held in
> a
> separate folder.  At present I have a master version of each script.  I
> then
> copy each script, edit it for the each different user, and save it to each
> folder.  This is a bit of a nightmare each time I get a new user.
>
> I thought it would be more convenient to group all the common functionality
> into user-created PHP functions, store then in a common area, and call them
> from each script as required.  That way I would only need to have one
> version of the common functions.  However, I have scoured the web to find
> out how to do this and come up blank.  I understand that you can use
> "include", but the included script needs to be in the same folder (I
> think).
> I want to be able to call a function and tell the script where that
> function
> is stored - i.e. call the function and specify the path to the function.
>
> Is what I am trying to do achievable, sensible, or is there a better way to
> do this?  Can anyone help me?  I am using PHP4.
>
> Thanks.
>
> Santilal Parbhu
>
>
Off the top of my head, I'd have to say you're crazy ;). I would first look
into .htaccess redirects if needed: When I started with the corp. I'm at
now, they were making a separate profile page for each user: They have
10000+ users. Their file structure preventing files from being created
anymore.

The most simple answer is using a .htaccess file,  then doing regex on the
URL to get the info you need (if you didn't pass it as GET).

Outside of that, using GET or SESSION variables should be easy enough. I'm
betting the .htaccess redirect will be what you want.

-- 
-Jack Timmons
http://www.trotlc.com



More information about the thelist mailing list