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
https://forums.phpfreaks.com/topic/275530-session-or-global-or/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.