I have a file.php?q=data that returns json data, but I don't want other websites to query my database through this file and I don't know what to do. I just have this:
if($_SERVER['HTTP_HOST'] != $_SERVER['SERVER_NAME']) exit();
Do you have any idea abut how to handle this security issue? Thank you very much.