title: Multiple Domains to vary content on shared host PHP files
body: <p>I have done some research on this problem without and solution yet.</p>
  
  <p>Setup as follows: Multiple domains say, www.domainA.com and www.domainB.com.
  Both domains are mapped a the same hosting folder on a LAMP server. I want the index.php file in that folder to 'know' which domain is accessing the files and vary content from SQL. I.e. load a different client ID specific to that domain.</p>
  
  <p>I've looked into <code>$_SERVER['REMOTE_HOST']</code> and <code>$_SERVER['HTTP_REFERRER']</code> the latter has been clearly stated to be unreliable. I am after a sufficiently robust solution.</p>
  
  <p><code>.htaccess</code> won't do the trick (I wouldn't think?) I was thinking something along the lines of domain DNS IP as a solid source for action. Would greatly appreciate some guidance.</p>
  
  <p>UPDATE: There have been some solutions suggested - I would like to have an SQL table which would contain all expected domains. TABLE clients ('id_client', 'client_name', 'client_url') and query this table returning the 'id_client' to a $variable.</p>
  
  <p>If $_SERVER['HTTP_HOST'] matches client_url in the database the corresponding id_client is returned. The .htaccess solution - however elegant - would require constant updating of the file. I'd prefer, where possible to keep solutions within the php and database.</p>
  
  <p>What circumstances with $_SERVER['HTTP_HOST'] fail?</p>