I have several html pages that I am looking to move into mysql tables and to be called using php. In order to porivde better security, I am looking at using a simple include file for each page to call the username and password for displaying the results of each table.
The include file would be along the following lines
password.php (file)
<?php
$dbhost='localhost';
$dbuser='username';
$dbpass='password';
$dbname='tablename';
?>
I am plan on putting this in a location outside the webroot. Now when i call the include file (password.php) from the page, do I need to provide the relative path, or will php find it on it's own?
I am doing this so that I only have to change one file rather than every single page if I change the username and password.
Also, I have tried calling a php function from a standard HTML page and all I get in return is the print php code. Do I need to do something in order for the php code to actually be called correctly instead of printing the code out?
Finally, what would be the proper file permissions and storage locations for php files?
The book I bought unfortunately is not as giving in information as I would like.
Thanks!