Htaccess Login and Password [duplicate]

2

I'm having a problem, I have a directory of different files of type csv, xls, pdf, docx ... I wanted the person.h that put in the browser the file link did not have access to it, only those that made access by the login page had access. How do I do this?

    
asked by anonymous 14.07.2017 / 16:50

1 answer

0

To do this, you will create an authentication system (much like login system).

Basic Ex:

<?php

if($_GET['url'] == 'arquivo'){
   if(!$_SESSION['login']['auth']){
       echo '<input type="text" name="email"><input type="password" name="senha">';
   }
}

The initial logic is this, but you have to move to something more complex, use Hash , and so on.

.htaccess

<Directory /caminho> 
    Options -Indexes 
</Directory>
    
14.07.2017 / 17:00