shane85 Posted August 18, 2009 Share Posted August 18, 2009 I was reading somewhere its very important to keep the database connection details (login pass) etc in the main directory so that hackers cant get the info and corrupt the database....is this true?? If so, where should these details be kept on the server??? Thank you Link to comment https://forums.phpfreaks.com/topic/170773-importance-of-placing-db-connection-details-in-different-filefolder/ Share on other sites More sharing options...
bubbasheeko Posted August 18, 2009 Share Posted August 18, 2009 Kind of..somewhat important. IE...you create a directory called settings and create a file call db.php. In the db.php file you will add the connection db stuff. You will then call it from the file you need it from with: <?php include('settings/db.php'); ?> It mainly keeps your code shorter so you don't have to keep adding the connection strings in each file, you simply need to call it. Link to comment https://forums.phpfreaks.com/topic/170773-importance-of-placing-db-connection-details-in-different-filefolder/#findComment-900642 Share on other sites More sharing options...
shane85 Posted August 18, 2009 Author Share Posted August 18, 2009 but how is this any safer I dont understand? couldnt they essentially hack this file? or is the point of it so if they hack the others they cant see it, where as only having it in the 1 file limits the chances?? I understand that it cleans up the code though, for sure Link to comment https://forums.phpfreaks.com/topic/170773-importance-of-placing-db-connection-details-in-different-filefolder/#findComment-900650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.