Question
PHP: protect folder "connections" on server?
Hi,
I'm afraid this is a newbie question, but I couldn't find the answer by searching the forum.
I installed locally, not on the shared webserver, IIS, PHP and MySQL. Then I went through the first part of "record store" tutorial
from the Dreamweaever Development Centre. I realized, DW is storing the login information to the mySQL database in a .php file within the folder "connections". Username and password are visible in this file:
$hostname_RecordStorePHP = "localhost";
$database_RecordStorePHP = "RecordStorePHP";
$username_RecordStorePHP = "username";
$password_RecordStorePHP = "password";
After working on this tutorial, I want to create a new database application. First locally. Then I want to transfer the project to my shared webserver at Godaddy. I will change hostname, database, username and password to the MySQL database at the shared webserver.
My question: How should I protect the user information within the folder "connections" on the shared webserver (Linux)? I know chmod and .htaccess for protection on Linux servers. Should I use one of those? If chmod is ok, how should I set the permissions to restrict access from outside, but to allow the php files on the webserver to connect to the database?
I couldn't find a tech paper covering this issue, so I hope, someone here can help...
Thank you very much!
Regards,
Thomas
I'm afraid this is a newbie question, but I couldn't find the answer by searching the forum.
I installed locally, not on the shared webserver, IIS, PHP and MySQL. Then I went through the first part of "record store" tutorial
from the Dreamweaever Development Centre. I realized, DW is storing the login information to the mySQL database in a .php file within the folder "connections". Username and password are visible in this file:
$hostname_RecordStorePHP = "localhost";
$database_RecordStorePHP = "RecordStorePHP";
$username_RecordStorePHP = "username";
$password_RecordStorePHP = "password";
After working on this tutorial, I want to create a new database application. First locally. Then I want to transfer the project to my shared webserver at Godaddy. I will change hostname, database, username and password to the MySQL database at the shared webserver.
My question: How should I protect the user information within the folder "connections" on the shared webserver (Linux)? I know chmod and .htaccess for protection on Linux servers. Should I use one of those? If chmod is ok, how should I set the permissions to restrict access from outside, but to allow the php files on the webserver to connect to the database?
I couldn't find a tech paper covering this issue, so I hope, someone here can help...
Thank you very much!
Regards,
Thomas
