文本文件在服务器上保护

时间:2013-08-20 11:34:56

标签: php security .htaccess

我有一个小的php应用程序供内部使用,通常我用户mySql数据库当然但在这种情况下我有文本数据库,例如dir结构:

publichtml/mydatabase

  publichtml/mydatabase/orders
      1.txt
      2.txt

  publichtml/mydatabase/invoice
      1.txt
      2.txt

  publichtml/mydatabase/user
      users.txt

我如何保护这个数据库,并且只允许使用此功能从我的php源访问:

$dat_example = substr(file_get_contents("mydatabase/orders/1.txt"),0,100000000000); 

由于

1 个答案:

答案 0 :(得分:0)

如果您使用cPanel托管只是密码保护mydatabase文件夹(密码保护目录选项)。