You are here: Re: variable scope problem? « PHP Programming Language « IT news, forums, messages
Re: variable scope problem?

Posted by Oli Filth on 01/20/06 00:18

J said the following on 19/01/2006 21:58:
> I have a page search.php which uses Top.php and Bottom.php to do most
> webpage stuff common to all pages. Top.php includes/requires
> KTConstants.php.
> Top.php can't see Constants/variables like $favoriateColor='234566'; defined
> in KTConstants.php
> I tried include instead of require.
> I tried using $GLOBALS['KTPTBlue']; perhaps I didn't do it right.
> The global keyword gives me an error...expected = or something.
>
>
<SNIP CODE>

See Example 12-2 at
http://www.php.net/manual/en/language.variables.scope.php. Note where
the "global" keyword is used.

--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация