How to only allow certain domain access php
Posted: Sun May 30, 2010 5:58 pm
I have a php file which will download files upon execute.
The issue is at now its not protected, anyone can use the script.
Info: The script is hosted on a remote server
I execute the script via a xml file, e.g my domain such as mydomain.com
how do i only allow mydomain.com can run that file.php and the rest include blank referrer will get forbidden or access deny etc.
Sorry cause i not sure how to phrase it , in simple i just wanna protect my php file from unauthorize access. Only domain mydomain.com can access the php file, rest get killed.
I tried use $_SERVER['HTTP_REFERRER'] or http host but it show the remote server ip.
The issue is at now its not protected, anyone can use the script.
Info: The script is hosted on a remote server
I execute the script via a xml file, e.g my domain such as mydomain.com
how do i only allow mydomain.com can run that file.php and the rest include blank referrer will get forbidden or access deny etc.
Sorry cause i not sure how to phrase it , in simple i just wanna protect my php file from unauthorize access. Only domain mydomain.com can access the php file, rest get killed.
I tried use $_SERVER['HTTP_REFERRER'] or http host but it show the remote server ip.