1

Hi i am currently having trouble to figure out how can i pass a second variable via url to a php file.

Bellow is the code

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);
}

So i have managed to pass the model, but i would like to add the date variable to. The date is defined by the user.

Any ideas or guidance what i should look into,

Thanks in advance.

  • 1
    Does this answer your question? [Passing multiple variables to another page in url](https://stackoverflow.com/questions/13102489/passing-multiple-variables-to-another-page-in-url) – Shahid Oct 24 '20 at 05:17

1 Answers1

0

try this

urlt='<?php echo base_url();?>excel/export.php?models='+model+'&yourdate='+data;

Please have a look at this answer.

yourdate is 2nd variable name that will pass now

Shahid
  • 60
  • 11