SMS Custom PHP failing

Hello to all,

I have been struggling with below PHP to be executed via


handler.php reads variable msg1 and is using jason to pass it to Javascript with later executing a script to a remote server.

When handler.php is executed directly from browser is works as expected with the delay http get -> jason -> JS -> http post to remote server.

Please help on what it might be wrong for the below not to execute via SMS custom

header("HTTP/1.1 200 OK");
if (isset($_REQUEST['msg1'])) {
    $msg1 = $_REQUEST['msg1'];
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
           sendCommand("", "username", "password", "13", "new1", (msg1 = <?php echo (json_encode($msg1)); ?>));  

Hello some help!

Really struggling to get the code to work with {CUSTOMPARAM} value

If I use browser and a numeric values it will show fine please please help