I'm trying to use AJAX to POST to a page and display the results but it's not sending all of the parameters.
function change_page(button){
var parent_div = $(button.parentNode);
var param = parent_div.attr("id");
var page = this.value;
var user = $("#user").val();
var ip = $("#ip").val();
$.ajax({
url: "gui_info.php",
type: 'POST',
data: { param : page, "user" : user, "ip" : ip },
dataType: "html",
success: function(data){
parent_div.html(data);
alert(data);
}
});
}
On the php page it's sending to, I'm using print_r($_POST)
to see which parameters are actually received. Only user
and ip
are succesfully being sent since the response is Array ( [user] => [ip] => )
whereas the param key/value aren't. I've checked the value of the the variables not being sent, they both exist. What am I doing wrong?