So I have a main page that gets data from a JSON link and populates a dropdown based on that data. My question is, currently anyone can access the URL where the json is getting printed to and I want to secure it so that only the server and the pages running on the server can access the JSON output.
I was thinking of comparing PHP server vars such as remote_addr and server_addr but the remote_addr is the clients IP and not the server.
What is a good way to go about doing this?
Thanks