I’m sending $.ajax to worker.php with this “data:pageref=streets&act=vw”.
When I make echo of $_GET[‘vw’]. I getting another value from different $_GET variable which was sent to worker php using ajax a long time ago.
How I should fix this? the first idea is to clean $_GET elements. any suggestions?
function ref() {
//
$.ajax({
type: "GET",
url: "worker.php",
data: "pageref=streets&act=vw",
success: function(msg){
document.getElementById('main_street_res').innerHTML=msg;
}
});
}
You try to echo
$_GET['vw']?In
datayou passpageref=streets&act=vw, so there are two keys:pagerefandact.If you echo
$_GET['act']you will getvw– it does not work in the other way.