PHP exec() wrong output
<p>I am executing an AJAX request using jQuery as such:</p>

<pre><code>$.get({
          url: 'run_program.php',
          data: 'action=run&amp;number=' + $('#number').val(),
          success: function (j) {
            alert(j);
          }
</code></pre>

<p>runprogram.php is as such:</p>

<pre><code>&lt;?php
if(isset($_GET['action']) &amp;&amp; !empty($_GET['action'])) {
    run($_GET['number']);
}

function run($number) {
    echo shell_exec('program.exe $number');
}
?&gt;
</code></pre>

<p>The response I get from the server is always 0. I am running this locally by the way, so there are no security problems. The program is simply coded to square the number passed in as input. It works perfectly fine in cmd. When I echo $number, it correctly gives the value that I passed in using jQuery. What is the problem in my code?</p>
