Hiding Files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hiding Files

    How can i hide a certain file in a directory listing? lets say, i dont want to see in the list the php.ini file?

    #2
    /// This will show all the files in a directory except php.ini
    Code:
    $file = '';
       if ($opd = opendir("directory/"))
       {
          while (false !== ($file = readdir($opd)))
          {
             if($file != 'php.ini')
             {
                
                   echo "$file'';
             }
          }
          closedir($opd);
       }

    Comment


      #3
      Thanks mate

      just found out that i can also do it in htaccess file
      <Files *.ini>
      Order Deny,Allow
      Deny from All
      </Files>

      Comment

      Working...
      X