Jump to content

How to limit the request url to a single domain name?


ivytony

Recommended Posts

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?

Link to comment
Share on other sites

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. ???

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.