Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Server Side Coding
PHP

Why is PHP ignoring my 'global'? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5553" title="Pages that link to Why is PHP ignoring my &amp;#039;global&amp;#039;?" rel="nofollow" >Why is PHP ignoring my &#039;global&#039;?\

Context
You have a global variable inside a function, that doesn't seem to be global at all. (ie. it doesn't have the value it's supposed to)

Likely solution
Your calling the function (a) where you declared the variable global from another function (b) where you set the variable.
But the variable isn't declared global in (b). So make it global there, and your problems will vanish.
(Tends to happen with callbacks all of the time ;-))

(Added by: Tyberius Prime on Tue 11-Feb-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu