Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.