I am trying to open second page this POST values (id_od_client, reports array, which includes only type of report and id of report). I want to generete report via phpword, but I have problem, that values are not posted. I think, it is due to posts and open page after success lost posted data.
I am trying
var url="complete_report.php?Id="+id_client;
$.ajax({
url: url,
type: "POST",
data: {
"id_client": id_client,
"report_array": report_array,
},
success: function(data){
////not work as expected window.location = url;
////not work as expected window.open('complete_report.php?Id='+id_client, '_blank');
////not work as expected window.location.href=url;
}
});
if I try in complete_report.php condition if(isset($_POST['id_client])) it not work.
Data are OK, but how to open in in new tab with posted data.If I tried method get and open file beforeSend it worked as expected.
Must be form action added in html form or somethink like that?
I think my issue is loosing POST value because of opening it later. I could be solved by sessions/cookies but it must be solved without that.
Also problem could be that complete_report does not anwering anything, just only create doc file.
I am not able to found the solution.
Kind regards
question from:
https://stackoverflow.com/questions/65843398/simple-ajax-call-and-open-the-page-in-new-tab-loosing-post-value 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…