I have a question related to finding the source of a request that comes to our site.
I have a PHP file that has a function and it returns a value. I want to call this function by Ajax through other sites that I have (I do not have a problem with this part).
I was wondering it is possible to check (in the PHP file) if the request for calling the PHP file or function comes only through the sites that I have and if it is not from the defined domains, it returns false.
Do we have any functions to check this matter?
I do not need client IP address, I need to know the domain that sends the request to my site and call my Php function. Do we have a mechanism to control this?
I only want my domains B and C are able to call my PHP function which is in my domain A.