I have .htaccess blocking a file on my server but when the file is included on index.php it will displays it without a password. Is there a simple way to have php check permission and ask for login?
The $_SESSION array and its related functions are usually used for such things.
[man]session_start()[/man]; [man]session[/man]
Also, see my signature for a tutorial on user authentication.