answersLogoWhite

0


Best Answer

you can put the connection file 1 level above your website's directory, and use random names, like 2134j12h5kh35.php

but really, if it's extension is .php, and in the unlikely event that someone knows where it is, the server will process it anyway and unless you echo your connection details for some strange reason, nothing will be displayed.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you protect your PHP database settings file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you store pdf file to database using PHP?

Files cannot be directly stored in a MySQL database. However, a path to the file or the contents of the file can.


What is the role of HTML in php?

HTML is one method by which PHP can output a response. Other response methods are file, database, email, and network (URI).


How do you run a MySQL query from PHP file?

Here is a simple script that you can do to run a MySQL query after you have set a database up. <?php // Database Settings $db['hostname'] = "localhost"; $db['username'] = "<db username>"; $db['password'] = "<db password>"; $db['database'] = "<db name>"; // Connect to MySQL $connect = mysql_connect($db['hostname'], $db['username'], $db['password']); // Select Database mysql_select_db($db['database'], $connect); // Do MySQL Query mysql_query("INSERT INTO table_name SET field_name = '1234567890'"); // Close MySQL mysql_close($connect); ?> Obviously you will need to use your own MySQL settings and database details, but this gives you a general overview of how you can do it.


What proportion of websites are dynamic say php?

A possible use case for dynamic content via PHP may be:page content (add content to a database and fetch it with PHP)news (news entries from a database or a file are read and put out to the user)forumsfaqjust to name a few


Is php a binary file?

No, PHP is text file with .php extension.


Can you open php file in your PC?

Since a PHP file basically is a text file, yes. But beware - opening and running a PHP file are not the same. If you want to run a PHP file, you will need a webserver with PHP module enabled.


What file extension is used to save a php file after code has been written into it?

The file extension for PHP is .php


What is the Malay-utf-8.inc. php file?

This particular file is a file specific to the PHP program or script you are using. It is not a "php system file".


How do you handle database in php?

Please refer link. The presentation gives complete understanding of how to deal with database (Mysql) with php.


What is the file extension .php?

A file whose extension is "*.php" are typically interpreted by the PHP language. (php.net)


What is a database in PHP?

Database = Where you save your data (ex: if a user fill your registration form, entered data should be saved somewhere, that's database) Usually in PHP we use MySQL Database.


How to you connect in mysql database?

Use the following code to connect to your mysql database from the php file. variables are hostname, db_username, db_password - see the code below for the exact connection example. <?php mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); echo "Connected to MySQL<br />"; ?>