javascript:variable value passing from javascript to php
<p>I have a <code>javascript</code> file <code>pet.js</code>. I want to pass a value of variable in <code>test.php</code>. But i can't.</p>

<p>my <code>pet.js</code> is like</p>

<pre><code>$('#pmWorkOrderDetailsPage').live('pageshow', function(event) {
var id = getUrlVars()["id"];
$.get("test.php", { test1: id } );
$.getJSON('pmworkorderdetails.php?id='+id, displaypmWODetails);
});

function displaypmWODetails(data) {
 ..............code..........
 }
</code></pre>

<p>My <code>test.php</code> is like</p>

<pre><code>&lt;?php
$ms = $_GET["test1"];
echo $ms;
?&gt;
</code></pre>

<p>But it is not working. I tried with <code>Ajax</code> and <code>post</code> method. </p>

<p>It will be best if I can store the variable value on the session in test.php.</p>

<p>Thanks in advance for any help.</p>
