title: How to use php to recevie notification (remote post) and run javascript?
body: <p>I have web application e.g A, A will generate and pop up B page (a QR code), after the users scanned a QR code, the thrid party server will send a "$_POST" to A application to <a href="http://example.com/notify/" rel="nofollow noreferrer">http://example.com/notify/</a> , how do i create a php function to echo some javascript (A page will keep opening)? </p>
  
  <p>I've tried added to A application's controller but it is not work</p>
  
  <pre><code>echo "success";     
  echo '&lt;script language="javascript"&gt;';
  echo 'alert("message was received")';
  echo '&lt;/script&gt;';
  </code></pre>