$calling_url = $_SERVER['SERVER_NAME'];
if(strpos($calling_url, ".timetask.com") === FALSE)
{
// might check a cache here otherwise:
$dns_records = dns_get_record($calling_url, DNS_CNAME);
if($dns_records !== FALSE && !empty($dns_records))
{
$dns_record = reset($dns_records);
if(isset($dns_record['target']) && !empty($dns_record['target'])
{
$calling_url = $dns_record['target'];
//might cache this value to skip constant lookups
}
}
}
// Do what you would normally do with $calling_url to determine the client id, etc.
1 to 2 of 2