Pass variable from javascript to PHP

前端 未结 5 371
一向
一向 2020-12-16 06:22

I\'m using Google Maps to make a map that can load markers with lat/lng data stored in a database. I want there to be three different \'layers\' that the user can load by cl

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 06:56

    If you do an ajax get request with the following url

    somePhpFile.php?varName=10
    

    Within your somePhpFile.php, you can do

    $v = $_GET['varName'];
    

提交回复
热议问题