Jump to content

session or global or ?


tanker456

Recommended Posts

I looked onlilne and found this forum and hopefully someone here can help.

 

I'm new to PHP and MySQL, but been programming for over 15 years in VB / .NET, so I do understand PHP and can learn quickly. I also know CSS and HTML and javascript, so I think I'm covered when it comes to client side development.

 

I have a new project that I need to code in PHP using Codeigniter as the framework. I took the last 3 months learning Codeigniter, and I have to say that I really like it.

 

Anyway, one of the things I need is to save information of what the user has chosen and have this be remembered from page to page.

 

There's a session object in Codeigniter that seems the way to go, but I just recently read about globals. Can I save things in globals for this purpose?

 

Or is there some other "mechanism" I can use in PHP?

 

Thank you very much for any response.

 

-Tanker456

 

Link to comment
Share on other sites

Not sure exactly what you are referring to when you say "globals" since that can mean a few different things. I'm guessing in this context you are referring to one of the superglobal arrays such as $_POST and $_GET. While you *could* use them to transfer information from page to page, it would not be a good solution. You definitely want to go with session data.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.