<?php
  $query = isset($_POST['q'])?$_POST['q']?'';
  header('Content-Type: application/json');
  header('Credentials: true');
  header("Access-Control-Allow-Origin: *.ampproject.org");
  //Should prob check the current host here, and redirect to the correct place
  header('AMP-Redirect-To: https://ruadhan-com.cdn.ampproject.org/c/s/ruadhan.com/amp/amp-live-list-3.html.php?q='.$query);
  header('Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin');
?>{"result":"ok"}