Forum Moderators: coopster
When the database connection file is placed on the server is it better to place the db connection file or the connection folder at the root level.
In other words is it better to have the folders Connection and public_html at the same level?
Or to move the connection FILE up one level so the connection FILE and public_html FOLDER at the same level?
It makes life easier if the folders connection & public_html are on the same level because it means files can be uploaded without having to alter the
code that calls the connection file.
What it comes down to is if both approaches are equally secure or does one approach offer added protection over the other.
So if you have a directory structure like this, put connect.php here:
/username/public_html/(all your web goodies here)
/username/connect.php
/username/connect.php
/username/connection/connect.php
Both of the above are good options. Go with either one - the first is probably easier.