"Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:
> I wanted to have all these functions on one master page called index.php,
> and then have one of the functions within my switch statement be used for
> display each individual page. So this function would include each separate
> php file, and then basically the master file has all of the functions that
> each page needs to function correctly. Is this a good idea?
Sure. If the code is going to get long or complex and a lot of the code
won't be used on an individual page you may consider splitting up the
functions in separate files in some logical fashion and include()'ing those
that are needed for each specific page.
> also. related question. if I have a file called index.php, and I include
> file bio.php on that page, will the $PHP_SELF variable be set to bio.php,
> to index.php?
index.php if you're simply include()'ing the content from bio.php. If
you're using Apache AliasRewrite magic and the URLs for each file are
pointing to the script index.php then it will be set to bio.php. A good way
to learn is to write short test scripts, add phpinfo() to the code and see
what the variables are set to.
President, Befriend Internet Services LLC
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]