I'm trying to pass URL variables to my PHPExcel PHP script, so that i can extract them in the script using the $_GET array.
The call to the PHPExcel script happens when a form (form1) button is pressed, and the variables are based on a second form (filters_form).
{filters_form is a general "filters" form that serves different scripts, for example filtering a JqGrid. meaning to say, it is separated from form1 for a reason. form1 is where i placed a button that calls the PHPExcel script, which also need to use the same filters that the filters_form provide}
Thus, I'm trying to use Jquery to call the PHPExcel script like that:
$(document).ready(function() {
$('#form1').click(function() {
var filters_form_serialized = $('#filters_form').serialize();
var URL = 'PHPExcel_script.php?' + filters_form_serialized;
$('#form1').attr('action', URL);
$('#form1').submit();
});
});
form1 is:
<form id="form1" action="" method="get" target="_blank">
<button id="form_button" type="button"></button>
</form>
filter_form is:
<form id="filters_form">
<input name="input1" type="checkbox" value="0" checked="checked" />
<input name="input2" type="checkbox" value="1" checked="checked" />
</form>
The PHPExcel script indeed gets called, BUT the script doesn't recognize/gets any of the variables in the $_GET array, e.g.:
if(isset($_GET['input1']))
{echo "TRUE";}
else
{echo "FALSE";}
returns FALSE.
any thoughts why?
Thanks!
P.S. i've checked using alerts that the URL is encoded correctly; moreover the exact same url with same variables is recognized correctly using other scripts.