I want to hide json file from public access. How do I do that?
You can check ip of requester at the top of your json fileif it's not your server then exit
This is example
if($_SERVER['REMOTE_ADDR'] != '190.180.0.1')exit ('You can not use this file');
and sure you have to replace ip with your server ip
i missed this part (and the javascript file is loading )
sure the above code will no't work because java script is client sideso if you blocked all requests except your server then your users also can't load this file