문제

I need to store mysql database access details in a flat file format. I.e in a .txt and the details on separate lines. I can easily do this, but then there is a big security flaw that the details.txt file can easily be navigated to and read by anyone.

How can I make it so that this is not possible.

I tired to save the files as a .php but then it does not read the lines with the command.

$lines = file('details.php');
도움이 되었습니까?

해결책

In your htaccess file you can add

<Files "database.txt">
    Order Allow,Deny
    Deny from all
</Files>

Which will prevent people accessing that file

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top