Pass a javascript variable to a php function
<p>I would pass a variable javascript to a php function but it doesn't work.</p>

<p>I call my javascript function in   <code>&lt;a href='javascript:showDetail(5);'&gt;detail&lt;/a&gt;</code></p>

<p>and this is the javascript function where call my <code>showInfo</code> php function</p>

<pre><code>function showDetail(id) {
        $.ajax({
          type: 'POST',
          data: {valore: id}
        });
        var add = "&lt;?php showInfo($_GET['valore']); ?&gt;";
        document.getElementById("detail").innerHTML = add;
    }
</code></pre>

<p>Where is my error? I call my function in the same page, without refreshing it.</p>
