title: How do you assign values to the results of a jquery/ajax post?
body: <p>I'm posting data to a php page using jquery. I want to then have the response from the page be able to be put into php variables on the original page. I don't want to append a DIV or show the results in the HTML. (This seems to be the only thing people do with post.)</p>
  
  <p>Here's the jquery:</p>
  
  <pre><code>$(document).ready(function () 
  {
      $('#drpdown').change(function() 
      {
          drpdownval=$('#drpdown').val();
          $.post("page2.php",{incomingval:drpdownval},function(result))};
  
      });
  });
  </code></pre>
  
  <p>PHP page2.php:</p>
  
  <pre><code>&lt;?php
  $valtoworkwith = $_REQUEST['incomingval'];
  ......../// do something
  ?&gt;
  </code></pre>
  
  <p>I want to then do something on page2.php then send specific values back to the jquery to work with. How? How do I assign them a name or separate them out??</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My jquery needed a number and not text.</p>
  
  <p>Here's the jquery:</p>
  
  <pre><code>$(document).ready(function () 
  {
      $('#drpdown').change(function() 
      {
          drpdownval=$('#drpdown').val();
          $.post("page2.php",{incomingval:drpdownval},function(result){
            if(result != 1){ ///could not put result !="hello" or != hello
            $("#signup").overlay().load();  
            }
          )};
      });
  });
  </code></pre>