How to POST value to PHP in the same page using jQuery
<p>I don't know if I'm just dumb. I have been trying to figure this out for the past 1hour. Please help!!</p>

<pre><code>     &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id="box" &gt;&lt;/div&gt;
&lt;div id="box2"&gt;&lt;/div&gt;

&lt;script type="text/javascript"&gt;
  $(function(){
  $('#box').html("Test");

    //$('#box').attr('name','Indy');
    //var a= $('#box').attr('name');
    $.post(window.location, {name: 'John'});


});

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php
print_r($_POST);
?&gt;
</code></pre>

<p>How do I pass the value? I know this works if the php is in a different file. But this is not the case here. </p>
