Hi, Is there any way to declare that some PHP file is used only for AJAX and that it cannot be rendered in client browser when he types its URL?
7/11/2020 4:26:07 PM
Dominik Vladař1 Answer
New AnswerNot possible. There is no way to detect what sent the request to the server. However, you can send an extra field ajax=true with the request. Then in your PHP <?php if(empty($_GET['ajax'])){ exit(0); } Note that this can not stop browser request that append ?ajax=true to the url
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message