Dan, there are many ways to handle user data. Every programmer has their own preferred way to do this.
In my experience, if there are a small amount of data needed, you can load that data into the $_SESSION[]
array when the user logs in. That data is gone once they close the browser or log out. This is not a good
way to handle it if there is a lot of data involved.
If there is only address, phone and logo names needed, that is easy to set up during the login process. You
just load that data into $_SESSION variables when the user logs in. Then, they are always there to be used
to display on orders or invoices, etc.
If you have a large number of different forms that require different data, then you need to think of how the
data is loaded to keep the speed of the system up to a good responsive level. Most likely this would mean
using your config_settings.php page in each of these to load the correct data for them. If the data changes
often, that is about the only way to get the current data. Using $_SESSION variables loaded upon user
login would not work well if the data can change during the user’s use of the site.
To recap these thoughts, it really depends on what the data is. Small amounts of user data that do not
change can be handled by setting them up when the user logs into the site and will be available to use
on any page in the system. Large amounts of data or if the data changes often must be reloaded as it is
needed on every page. The best place to start is to make a list of all your data needed and mark which
could change during the user’s access to your site. That would give you an idea how to handle it’s access.
Not sure if this helps, but, gives you some things to think about to get you started.
EDIT: Added… Note that “USER” data and “INVOICE” data are two different things. User’'s data seldom
changes and I usually use the $_SESSION array for those. Invoices and order info constantly change, such
as adding/removing items, shipping status and other things which makes this data needing refreshing at
each time it is used…