将多个变量传递到 PHP 文件
Pass multiple variables to PHP file
您好,我目前无法弄清楚如何通过 url 将第二个变量传递给 php 文件。
下面是代码
function getmodel()
{
var mod = [];
jQuery('.cells:checked').each(function()
{
mod.push($(this).val());
});
model=mod.toString();
var date = document.getElementById("date").value; // this is the variable that i would like to pass next to the model
urlt='<?php echo base_url();?>excel/export.php?models='+model;
window.location.replace(urlt);
}
所以我已经设法通过了模型,但我想将日期变量添加到。日期由用户定义。
任何我应该研究的想法或指导,
提前致谢。
试试这个
urlt='<?php echo base_url();?>excel/export.php?models='+model+'&yourdate='+data;
请看看这个answer。
yourdate 是现在将通过的第二个变量名称
您好,我目前无法弄清楚如何通过 url 将第二个变量传递给 php 文件。
下面是代码
function getmodel()
{
var mod = [];
jQuery('.cells:checked').each(function()
{
mod.push($(this).val());
});
model=mod.toString();
var date = document.getElementById("date").value; // this is the variable that i would like to pass next to the model
urlt='<?php echo base_url();?>excel/export.php?models='+model;
window.location.replace(urlt);
}
所以我已经设法通过了模型,但我想将日期变量添加到。日期由用户定义。
任何我应该研究的想法或指导,
提前致谢。
试试这个
urlt='<?php echo base_url();?>excel/export.php?models='+model+'&yourdate='+data;
请看看这个answer。
yourdate 是现在将通过的第二个变量名称