This question already has an answer here:
I use this code to disallow direct access to php file
if (__FILE__ == $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF']){
die("Direct access forbidden");
}
My problem is I need to call the php this way
xmlhttp.open("GET","getverse.php",true);
it also return Direct access forbidden
error.
How can I allow this call to php file while disallowing direct access to it from a browser?
Thanks
</div>