0

I want to pass more then one value in GET request with JS.

However, the way I am currently trying it does not work.

The function I am using for that is given below:

<script type="text/javascript">
  function updatestatus(status, id){
    var xmlhttp=new XMLHttpRequest();
    xmlhttp.open("GET","adminfunction.php?status="+status"id="+id,false);
    xmlhttp.send(null);
  }
</script>   

thanks for the help.

RobC
  • 22,977
  • 20
  • 73
  • 80
TCR
  • 3
  • 3

2 Answers2

0

Add and & in your url

xmlhttp.open("GET","adminfunction.php?status="+status"id="+id + "&another=" + newVar,false);
jerome
  • 695
  • 6
  • 20
0

Add & to your url when you pass another variable.

You also forgot a +.

Change :

xmlhttp.open("GET","adminfunction.php?status="+status"id="+id,false);

To :

xmlhttp.open("GET","adminfunction.php?status="+status+"&id="+id,false);
Sébastien S.
  • 1,444
  • 8
  • 14