how to retain old values of globle variales in sessions - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

how to retain old values of globle variales in sessions

aasha_jagdishaasha_jagdish Posts: 1Member
Hi,

I am designing an online game named SHABD PURNA. In this game there I want to manage sessions. In these sessions I am unable to retain the old values of the globle variables. How can retain the values of the old globle variables?

Comments

  • tvientitvienti Posts: 230Member
    [b][red]This message was edited by tvienti at 2006-2-9 11:15:44[/red][/b][hr]
    (global, btw)

    The general idea is that if you want to save a variable, you store it in $_SESSION. You don't usually need to save ALL global data in the session, that just seems to me like overkill. If you do indeed, then you'll need to store the contents of the $_GLOBALS array in $_SESSION.

    The bottom line is this: whatever you put in $_SESSION is saved from page to page, assuming sessions are on and working. Anything else is reinitialized on each page view.

    T

    [red][b]Edit: I meant $GLOBALS, not $_GLOBALS, whoops :)[/b][/red]

    : Hi,
    :
    : I am designing an online game named SHABD PURNA. In this game there I want to manage sessions. In these sessions I am unable to retain the old values of the globle variables. How can retain the values of the old globle variables?
    :
Sign In or Register to comment.