MySQL Forums
Forum List  »  PHP

Re: How to store password for mysql_connect()
Posted by: Oliver Block
Date: April 25, 2006 02:07PM

Please add this to the file .htaccess if you are storing your password in an .inc file
The .htaccess should be at least in the same directory or in a parent directory.

<FilesMatch "\.inc$" >
Order Allow,Deny
Deny from All
</FilesMatch>

It prevents others to read the content of your .inc file in their browser.

<?php
$host = "db.mydomain.com";
$username = "karl";
$password = "mysecret";
...
?>

Best regards,

Oliver



Edited 1 time(s). Last edit at 04/25/2006 02:08PM by Oliver Block.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.