php - Making User Information Available on Every Page -


I am an amateur, valid, but I am trying to learn a bit more about programming, and php general In, using CodeIgniter.

I have a test site and it's going on and I think I have a decent understanding of MVC. Even though without any formal background, I know that my architecture is bad and dirty, so I From time to time, I choose the best methods from all those information (which is you).

There is some data about users who want to access each page like I want to say that the data is stored in 3 different DB tables. The only way I can consider getting information in every controller is to create a model that pulls this data and then calls the model in each controller, passing the data on the scene.

Another idea is to create a library that loads the model, automatically loads it, and then I take the specific data of the function in the library when I want it. .

Am I thinking about this correclty?

Thank you.

You can use

When a user is logged in, he stores his basic information in the session when he receives the database. Now you can get them directly from the session and show them on any webpage. Make sure that this information does not have user password :)


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -