search

Home  >  Q&A  >  body text

我申请了一个不带数据库的php空间,我现在的应用数据是存在文件中的,但是这会有一个安全问题,就是 访问者可以通过url查看到这些文件的内容,我怎么保护这些文件内容呢?

小水滴小水滴2980 days ago927

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:30:52

    I applied for a PHP space without a database. My current application data is stored in files, but this will have a security problem, that is, visitors can view the contents of these files through the URL. How can I protect these? What about the file contents? -PHP Chinese website Q&A-I applied for a PHP space without a database. My current application data is stored in files, but there is a security issue, that is, visitors can view the contents of these files through the URL. I How to protect the contents of these files? -PHP Chinese website Q&A

    Let’s take a look and learn.

    reply
    0
  • 怪我咯

    怪我咯2017-02-23 14:06:21

    建议的方式有三种: 
    1)如果你租用的php空间允许设置目录的http访问权限,那么设置一下即可。 
    2)可以对文件内容进行加密,那么即使被下载,也没有多大的价值。 
    3)可以将这些文件的后缀改为.php,即使用php文件存储应用信息,这样的话,访问者就无法通过http访问到 
    这些文件的真实内容了,当然这些文件中的内容必须是正确的php语法,而且内容要使用php语法中的隐藏语法 
    将信息隐藏起来,例如一个存放帐号信息的文件如下: 
    users.php 

    <?php 
    /* 
    :::user1:password1::user2:password2::user3:password3::: 
    */ 
    ?>


    reply
    0
  • Cancelreply