I am having a problem with response data. I want to use the response data in my php file. I want to assign them to a php variable.
Here is the ajax code in the insert.php file.
function change(){ var tp=$('#choose').val(); var country_val=$('#country_filter').val(); //alert(country_val); //var country_val=$('#country_filter').val(); $.ajax({ type: "POST", url: "filter.php", data: { name: tp, country:"test"}, success:function( data ) { alert(data); } }); }
here is the php code in the filter.php file
if($_REQUEST["name"]){ $lvl = $_REQUEST["name"]; //global $lvl; echo $lvl; }
Now I want to use the response data that will be assigned to the php variable in the insert.php file. How can i do this? Please, help.
Hriju source share