Hello how are you, I am trying to execute a command through the shell_exec() function and then assign the execution value to a javascript tag but I am facing a problem with the javascript
PHP code
$result=shell_exec("dir");
echo <<<"go"
<script>document.getElementById("pre").innerHTML="$result"</script>;
go;
HTML code
<div id="cmd"><pre id="pre"></pre></div>
The JavaScript problem that appears when executing the code is:
Uncaught SyntaxError: "" string literal contains an unescaped line break