Hi there.
When building php files in the past I have always added a line of code to connect to the database including the db name, username and password.
A tutorial I have just read suggests that you may declare these details as variables in a .inc file and simply have the script call this file whenever a page is loaded.
This sounds like a great idea as it would allow me to move files from test to production without having to recode everytime.
Do many of you do it this way? If so, are there any added security risks in keeping these details in an external file?
Thanks.
When building php files in the past I have always added a line of code to connect to the database including the db name, username and password.
A tutorial I have just read suggests that you may declare these details as variables in a .inc file and simply have the script call this file whenever a page is loaded.
This sounds like a great idea as it would allow me to move files from test to production without having to recode everytime.
Do many of you do it this way? If so, are there any added security risks in keeping these details in an external file?
Thanks.