I want to click a button on a page and go to another page with posted data but it's directing without posting ! $_POST is empty and $_SESSION also is empty
here's my ajax function :
function ajax4(Div_Submit,Div_Response,SuccessScript,Data_Submit)
{
var Type = 1;
var post_data = '';
if(!Data_Submit)
post_data = $('#'+Div_Submit+' *').serialize();
else
post_data = Data_Submit;
$.ajax({
data: post_data,
type: "POST",
url: document.URL,
dataType: 'text',
success:function(response){
$('#'+Div_Response).html(response);
window.location.href = "index.php";
}
,
complete: function(){
$.unblockUI();
}
});
return false;
}
what's wrong with my code ?