h20boynz Posted October 12, 2010 Share Posted October 12, 2010 What I have done in the past is created a conn.php file, used as an include, when I wish to connect to my DB. As a security measure, rather than have my connection info in a file that could potentially get accessed by unauthorised users, I read that I could use environment variables and store the database connection string values i.e username, password etc for retrieval. Can anyone offer some guidance on going about this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/215660-using-custom-environment-variables-for-db-conn/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2010 Share Posted October 12, 2010 have my connection info in a file that could potentially get accessed by unauthorized users If someone has direct access to the contents of your files on the server, they would also have direct access to any other method you are using to define the database connection details. What makes you think that putting your connection information in a file is not secure? Quote Link to comment https://forums.phpfreaks.com/topic/215660-using-custom-environment-variables-for-db-conn/#findComment-1121309 Share on other sites More sharing options...
h20boynz Posted October 12, 2010 Author Share Posted October 12, 2010 It wasn't that I thought it was insecure...just that this particular book offered this as an option. Quote Link to comment https://forums.phpfreaks.com/topic/215660-using-custom-environment-variables-for-db-conn/#findComment-1121310 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.