Answer the question
In order to leave comments, you need to log in
How to secure a file from direct access?
I have a browser JS script on AJAX. In which it refers to the conditional "chat.php", how to make it so that this file cannot be accessed directly, but only through JS?
Answer the question
In order to leave comments, you need to log in
Set a password so that access is only possible if a POST request is made with a password.
A few ideas, as they get more complex:
/chat.php
- return a stub, or, better, a redirect to the main.chat.php
check for its presence.chat.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question