RE: [PHP] Problems with require() and variables
| From: | Ford, Mike [LSS] | Date: | Thu, 16 Jan 2003 10:49:32 +0000 |
| Subject: | RE: [PHP] Problems with require() and variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-131837@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Phil Powell [mailto:soazine@erols.com]
> Sent: 16 January 2003 04:33
>
> I have view.php, a script that will include display.php and
> have to manipulate the variables within display.php for itself.
>
> So in view.php I have:
>
> require('/.../.../display.php');
>
> However, when display.php finishes being "required", I lose
> all of my variables that I need for view.php. How do I
> retain them??
You don't need to -- the included file is effectively part of the including file, so all
variables available in one are equally available in the other.
> How can I ensure that these variables in
> display.php will also exist in view.php?
By doing nothing. You must be doing something else wrong. Show us your code (or a relevant sample,
if it's big!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211