title: Cross-Origin Request Blocked: (Reason: CORS header 'Access-Control-Allow-Origin' missing)
body: <p>Following is my php code:</p>
  
  <pre><code>&lt;?php
      header('Access-Control-Allow-Origin: *');
      header('Access-Control-Allow-Methods: GET, POST');
      header("Access-Control-Allow-Headers: X-Requested-With");
      include 'dbconnection.php';
      try{
          if (isset($_GET['term'])){
          $return_arr = array();
  
          $stmt = $conn-&gt;prepare('SELECT JOBNO FROM PRTJOBHD WHERE JOBNO LIKE :term');
          $stmt-&gt;execute(array('term' =&gt; '%'.$_GET['term'].'%'));
  
          while($row = $stmt-&gt;fetch()) {
              $return_arr[] =  $row['JOBNO'];
          }
  
          } 
      }catch(PDOException $e) {
          echo 'ERROR: ' . $e-&gt;getMessage();
      }
  
      /* Toss back results as json encoded array. */
      echo json_encode($return_arr);
  ?&gt;    
  </code></pre>
  
  <p>I'm getting a error that "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://192.168.0.102/ipack/search.php?term=a" rel="nofollow">http://192.168.0.102/ipack/search.php?term=a</a>. (Reason: CORS header 'Access-Control-Allow-Origin' missing)." while running on browser. </p>