0

I would like to be able to pass my JS value into my php function whitout reloading page,indeed I use LeafLet for my map , and my function show popup informations on passing an Id on params

   var idcustom= custom[key];

               <?php $infopopup= $objects->ShowBindPopup($_SESSION['Users'],here i want to pass my "idcustom" var from js); ?>

I know that there is server/client difference , but i want to know an alterntive solution Thanks for you'r help !

DEVLOGIN
  • 87
  • 1
  • 9
  • 4
    Possible duplicate of [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – B001ᛦ Dec 13 '18 at 08:50
  • ShowBindPopup($_SESSION['Users'],."".); ?> – Monica Acha Dec 13 '18 at 08:56
  • short answer: use Ajax – Robin Zigmond Dec 13 '18 at 08:57
  • ++Robin: If you want to execute php without reloading the page. You can do this with ajax requests. For instance if you would use a javascript library like jQuery, you can get the data with https://api.jquery.com/jquery.get/. (examples can be found on the page) – Sam Segers Dec 13 '18 at 08:59
  • I can't use ajax for this ,beaucause i got many ID to showup at the same time . Indeed I used leaflet, and i want to create specifcal popup for each markers – DEVLOGIN Dec 13 '18 at 15:53

0 Answers0