If you know you are running on an apache server, you could try using a
simple .htaccess file in a (say) etc directory which contains any or all
files you wish to secure.

ie:

/index.php
/etc/config.php
/etc/.htaccess

--index.php--------
<?php
include("etc/config.php");
...
?>

--etc/config.php--------
$config['db_host']="sql";
$config['db_name']="root";
$config['db_pass']="hooray";
?>

--etc/.htaccess--------
deny from all


And that's it!


Duky Yuen <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can I secure my username and password? In 1 of my files, it contains
> the following:
>
>     $conn = mysql_connect( "12.34.56.78", "username", "password");
>     mysql_select_db("database",$conn);
>
> What should I do, so people can't get this information?
>
> Duky
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to