How to echo a variable from jquery POST to another page
<p>How to use the a variable that is posted from page1 to page2 from jquery.I am using the following scenario</p>

<pre><code>page1.php

    if ( this.checked ) { 
            $.ajax({
                url: 'page2.php',
                type: "POST",
                data: ({name: 145}),
                success: function(data){
               //$("#result").html(data);
                }
            });        

        }
</code></pre>

<p>This is not working why,if i separatly opens a page2.php and wants further usage of the post data</p>

<pre><code>    Page2.php
    &lt;?php
    $userAnswer = $_POST['name'];    
    if ($_POST['submit']){
         echo $userAnswer; 
    }       

    ?&gt;
    &lt;form method="post" action="page2.php"&gt;
&lt;input type="submit" value="submit" name="submit" /&gt;
&lt;/form&gt;
</code></pre>

<p>if i open page2.php and presses the submit button,the posted value from page1 is not displaying</p>
