I want to put a javascript code in PHP variable exactly like this:
$ch = '<script> var w = window.innerWidth; var h = window.innerHeight; var id = "'. $row['ch_id'] .'" ; document.write(<iframe width="'+w+'" height="'+h+'" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" allowtransparency="true" src="http://www.exemple/embed.php?width='+w+'&height='+h+'&channel='+id+'&autoplay=true"></iframe>); </script>';
I give me this error:
Notice: Use of undefined constant w - assumed 'w' in /test.php on line 9
Notice: Use of undefined constant h - assumed 'h' in /test.php on line 9
Notice: Use of undefined constant w - assumed 'w' in /test.php on line 9
Notice: Use of undefined constant h - assumed 'h' in /test.php on line 9
Notice: Use of undefined constant id - assumed 'id' in /test.php on line 9
Whats wrong on the code ?
Thanks in Advance