Re: dynamic include
| From: | Matt McClanahan | Date: | Sun, 11 Jun 2000 07:43:37 +0000 |
| Subject: | Re: dynamic include | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1557@lists.php.net to get a copy of this message | ||
On Sat, 10 Jun 2000, sarahana wrote:
> Is it true that you can't include a file with a query string? for
> example, if the file is file.php?type=task, then I want the file.php to
> include action.php?type=task.
It's true for two reasons. First, PHP includes don't involve the web
server, so HTTP query strings are somewhat useless. Second, whenever you
include a file, all variables, functions, objects, etc. are automatically
inherited by the included file.
So, file.php?type=task has a $type variable set in the scope of the
script. When you include('action.php'), action.php will also have a $type
variable set.
Matt