ivytony Posted January 25, 2009 Share Posted January 25, 2009 I have a PHP file that processes the variables passed through a URL, for example: The PHP file name is: process.php Variables passed through url: $start and $number, (e.g. http://www.domain2.com/process.php?start=1&number=20) process.php uses a function to process these two variables. I would like to prevent people using this page to return values. I wonder how to limit the access only to my own website 'domain2.com'. Is there anyway to do this? Quote Link to comment https://forums.phpfreaks.com/topic/142407-how-to-limit-the-request-url-to-a-single-domain-name/ Share on other sites More sharing options...
premiso Posted January 26, 2009 Share Posted January 26, 2009 Your question is really vague. How would someone access another site other than domain2.com? Do you have a known security hole in your code? Quote Link to comment https://forums.phpfreaks.com/topic/142407-how-to-limit-the-request-url-to-a-single-domain-name/#findComment-746158 Share on other sites More sharing options...
ivytony Posted January 26, 2009 Author Share Posted January 26, 2009 sorry, I should have made my question easier to understand. The PHP code in the particular page process.php doesn't have any security hole. The process.php page can get the youtube video details by providing a youtube video ID. However, I want to have this page be accessed exclusively by my own website 'domain2.com', while keeping others from using my page to get youtube video details. I think there must be someway to control the request access. ??? Quote Link to comment https://forums.phpfreaks.com/topic/142407-how-to-limit-the-request-url-to-a-single-domain-name/#findComment-746294 Share on other sites More sharing options...
premiso Posted January 26, 2009 Share Posted January 26, 2009 You can check referrer, but that can be spoofed. Really this is a form of hotlinking, I would look into Hot linking tutorials that help prevent people from using your site for information. Not sure how much that will help, but take a look into it. Quote Link to comment https://forums.phpfreaks.com/topic/142407-how-to-limit-the-request-url-to-a-single-domain-name/#findComment-746562 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.