What i want to do is that when the request is made from any server I want to get the referrer url so I can check if this url is allowed to access my file or not, I have some plugins and on update check on admin side they will check versions connecting my site. So, the plugins are registered with clients site.
Here is my curl code sends referrer but I want to send referrer secretly so no one can change my code easily.
public function checkUpdate($task , $product) {
$parameters = array(
'task' => $task,
'product' => $product,
'domain' => $_SERVER['HTTP_HOST']
);
$curl = curl_init();
$parameters_str = '';
$url = "http://example.com";
foreach ($parameters as $key => $value) {
$parameters_str .= "$key=$value&";
}
$url .= "?$parameters_str";
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
I hope you understand me. Or if you have better solution to do this work like check license of my clients then it will be great! Please also let me know if you think the question is not good or not explaining well in comments.
Thanks in advance.