Re: included_by() possible?
| From: | Wico de Leeuw | Date: | Fri, 25 Aug 2000 08:03:12 +0000 |
| Subject: | Re: included_by() possible? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-30595@lists.php.net to get a copy of this message | ||
Hiya
Maybe i see this wrong but in a include you can check $PHP_SELF and stuff
that should give you the page that called the include or am i wrong
Greetz,
Wico
At 09:48 25-8-00 +0200, André Langhorst wrote:
If you´d read the whole thing, you´d know OR I totally failed explaining in short-style. a) If you distribute PHP-apps to users, which absolutely do not know what PHP or even a sss-lanuage is, it´ll be better to let them include <?php include('php.app.php'); ?> instead of <?php $foobar=__FILE__; include('php.app.php'); ?> so that they think they plugged in a component. b) If you meant it the other way round, what should I do with that information, well, if the included files do the whole processing and you need to generate forms and links pointing to the *same* app, you cannot use __FILE__ because it is useless. You have to use $foobar, which must be included in the code the user needs to include. Eg. when the compiler is available, you can create applications that a) are configurable with a config script, maybe a normal .php file b) you´ve the compiled application you include with include() c) you´ve just <?php include('php.app.php'); ?> this code, and the user can´t do *anything* wrong instead of passing the wrong filename, but that he´ll fix very fast. I would be practical. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.netThe main question is why an include file needs to know which file included it.