title: enabling CORS for set of websites
body: <p>I am using </p>
  
  <pre><code>header("Access-Control-Allow-Origin: *");
  </code></pre>
  
  <p>in my php files to enable CORS for ajax request on cross sites. I have list of websites stored on my database. Now my problem is how could I enable CORS only for the websites stored on my database, and block ajax request from rest of the websites which are not listed in my database. Also I want to know about drawbacks and solution of enabling CORS for all websites for cross site ajax request.</p>