php jquery dynamic dropdown -


i having problem sending/reading ajax variable.

ajax code below:

$.ajax({     url: "/wp-content/themes/canvas-child/get-clients-dropdown.php?it=1",     success: function(data) {         $("#clientid").html(data);     } }); 

i have tried read in php file this:

$invoicetype = $_request['it']; //$invoicetype = $_post['it']; //$invoicetype = $_get['it']; 

but none of above works. variable $invoicetype stays empty.

what problem?

the best way use post method : $.ajax({ method: "post", url: ""/wp-content/themes/canvas-child/get-clients-dropdown.php", data: { it: 1, param2: "value2" } })

you can value in $_post['it']


Comments