RE: [PHP] include/require inside of function
| From: | Ford, Mike [LSS] | Date: | Tue, 08 Jul 2003 15:33:54 +0000 |
| Subject: | RE: [PHP] include/require inside of function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154386@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ow Mun Heng [mailto:ow.mun.heng@wdc.com]
> Sent: 08 July 2003 15:53
>
> Here's the thing.. I declared $page_title = "My Page Title" in a
> file called config.php which is included in the index.php
> page. when I tried
> to -> echo $page_title <- Nothing comes out.
>
> If I declared it as global $page_title , then "My Page
> Title" would
> be echoed out.
And is the assignment in the included file inside a function? If so, the
usual rules about variables within functions apply. If not, please post the
relevant code from both files so we can try to figure out your problem.
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