Zen Follower
- Join Date:
- Jun 2008
- Location:
- Osprey, Florida
- Posts:
- 147
- Plugin Contributions:
- 7
Connecting to the database for Ajax Search... Making it safe.
I'm working on an Ajax Search plugin. As of right now I have search.php file which I'm uploading to the root level of the server. In order for the plugin to work, I need to connect to the database therefore I'm adding the settings for sever, user, database name and database password from configure.php.
Thus far it works either of the following two ways
I just add:
include('includes/configure.php');
or add :
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'root');
define('DB_SERVER_PASSWORD', 'root');
define('DB_DATABASE', 'database');
The ideal would be to use the first example since there would be no need to modify the file but regardless, I'm concerned about exposing any settings that could compromise the safety of the website.
How can I make this file safe from intrusion other than just setting the permissions to read only?
Is either of these examples above safer than the other?
Thanks for any advice.