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.)
Here's the jquery:
$(document).ready(function ()
{
$('#drpdown').change(function()
{
drpdownval=$('#drpdown').val();
$.post("page2.php",{incomingval:drpdownval},function(result))};
});
});
PHP page2.php:
<?php
$valtoworkwith = $_REQUEST['incomingval'];
......../// do something
?>
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??
EDIT
My jquery needed a number and not text.
Here's the jquery:
$(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();
}
)};
});
});