There is a button:

<button id = "changelog" name="changeSend" type="button" class="btn btn-primary btn-xs active" data-toggle="modal" data-target="#main-modal">Edit</button> 

It calls a modal window. It is necessary that she calls the window and passes the php variable to this window. How to do it? It is desirable means of php .

Modal window:

 <div class="modal fade" id="main-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="myModalLabel">Изменение рассылки <? echo $lalka; ?></h4> </div> <div id = "modal-text" class="modal-body"> <ul> <li>AJAX-отправка запросов</li> <li>Уведомление о результате создания рассылки</li> <li>Напоминание при незаполненных полях</li> <li>Весь функционал перенесен</li> <li>Почищен код, часть переписана.</li> <li>Улучшены логи</li> </ul> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button> </div> </div> </div> </div> 

Closed due to the fact that the essence of the question is not clear by the participants aleksandr barakin , Streletz , user194374, D-side , gecube 6 Jul '16 at 2:10 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Pressing a button, I suppose, is somehow handled? Apparently, using javascript. This is the code that matters. - Gino Pane
  • one
    Use AJAX, and get your variable. And then put in the window. - Maxim Drobyshev
  • @GinoPane, there is no handler, this is Bootstrap, maybe it processes as well, I really don’t know. - Anton Burak
  • @ MaksimDrobyshev, $.ajax({ type: "POST", url: "delete.php", data: {'index':ind}, success: function(e) { location.reload(); } }); So? - Anton Burak
  • @ AntonBurak in this case, the page will reload. You have such an event spelled upon successful completion. And yes. Make a request, create a separate function that will receive the result. Let's say function resultDelete (forecastData). And we write its name after success. The forecastData will contain what the delete.php script prints at runtime. This may be Json. Try it. - Maxim Drobyshev

0