phpjim Posted February 10, 2013 Share Posted February 10, 2013 (edited) I have been reading several PHP books and I thought I run something by some of the experts here. Most books show passwords to connect to databases, constants, configuration settings,etc. enclosed in an include.php file that is not in the root directory. I was wondering instead of using an include file, do some of you use a table to store these items to make your site data driven? If yes, what would be an example of how you use a table instead of an include file to control your program? Another question I have is do any users alter system variables, such as a session variable or other system variables to store variable or user data so they can be accessible from any script. If yes, what would be an example of how you would use this strategy? I am just thinking out loud as I am use to programming where a variable or constant set in the main opening program can be used by any other calling program (global). I was thinkng if there is a way to accomplish this by adding information to a session or system variable and then parse out when needed. Thanks Edited February 10, 2013 by phpjim Quote Link to comment https://forums.phpfreaks.com/topic/274280-do-you-use-includes-or-a-table-for-data-driven-apps/ Share on other sites More sharing options...
Zane Posted February 10, 2013 Share Posted February 10, 2013 What exactly do you mean by storing those items in a table? If you are talking about a database table then that is just outright illogical. You would need to be authenticated in the first place to access that table. To answer your second question, Yes. Pretty much any server-side language will be able to store session data as well as create cookies. PHP offers $_SERVER variables as a means to get the information of the user. Data such as the user's IP, browser name, referring page, operating system, etcetera are all available in the $_SERVER superglobal. While this variable is not readonly, it is useless to store data in since each page refresh will, AFAIK, generate a rebooted array of values. PHP is a very very well documented language, it is even safe to say that it is the BEST documented language. Take a look through it if you haven't already. Quote Link to comment https://forums.phpfreaks.com/topic/274280-do-you-use-includes-or-a-table-for-data-driven-apps/#findComment-1411470 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.