Re: need an opinion on this idea of mine...!!

From: Date: Mon, 09 Jul 2001 21:07:52 +0000
Subject: Re: need an opinion on this idea of mine...!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57011@lists.php.net to get a copy of this message
"Chris Cocuzzo" <cuzo@mediaone.net> 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 the > file bio.php on that page, will the $PHP_SELF variable be set to bio.php, or > 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. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/

« previous php.general (#57011) next »