wanted to ask you for a little help. I have small script, which returning search results:
$(document).ready(function(){
$('#search_text').keyup(function(){
var txt = $(this).val();
if(txt != '')
{
$.ajax({
url:"fetch_nod.php",
method:"post",
data:{search:txt},
dataType:"text",
success:function(data)
{
$('#result').html(data);
}
});
}
else
{
$('#result').html('');
}
});
$('#create_excel').click(function(){
var excel_data = $('#nod_dat2').html();
var page = "excel.php?data=" + excel_data;
window.location = page;
});
});
And it also exporting result on excel after button click, but on lager amont of data, I getting error Request-URI Too Large. I can not figure out, how to turn excel export to post reques. Could you help me please. Here is code of excel.php file:
header('Content-Type: application/vnd.ms-excel');
header('Content-disposition: attachment; filename='.rand().'.xls');
echo $_GET["data"];