title: protect web page from ajax request
body: <p>i want to know the best way to protect my php scripts from ajax requests that did not originate from my site or by the use of Access-Control-Allow-Origin. Because it is possible for external pages to call my php codes with ajax requests. 
  Thanks</p>