PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
With the register globals turned on, when i run this script first time i got "happy" at the second echo, but when i make refresh and any refresh after that i get "joy joy", can you explain me why this happens? It seems like writing the new value in the session file is delayed and i don't understand why.
fastfingertips wrote:With the register globals turned on, when i run this script first time i got "happy" at the second echo, but when i make refresh and any refresh after that i get "joy joy", can you explain me why this happens? It seems like writing the new value in the session file is delayed and i don't understand why.
register_globals does not make $_SESSION['joy'] and $joy point to the same memory address. register_globals actually copies the values from the superglobal arrays into variables. So, when you change $joy, the actual $_SESSION['joy'] is not altered, but the final session data is.