Passing multiple parameter to PHP from Javascript

前端 未结 2 1733
一个人的身影
一个人的身影 2020-12-21 08:44

i am trying to Use this

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpR         


        
2条回答
  •  清歌不尽
    2020-12-21 09:12

    You add them to the URL string, so:

    var url="myPhp.php?a=1&b=2&c=3";
    

    then you can access them in PHP from the $_GET array:

    $Param1 = $_GET['a']; // = 1
    $Param2 = $_GET['b']; // = 2
    $Param3 = $_GET['c']; // = 3
    

提交回复
热议问题