0

i need to pop a bootstrap modal but from inside will need to make queries from a PHP variable that will vary depending on where the pop originated from.

so i have this in my file :

<a href="#" class="btn btn-md btn-success"
    data-toggle="modal"
    data-target="#editUser"
    id="User"
    data-id="UserID123">
    update
</a>

How can I put the value UserID123 in a php variable once in the modal so I can use it for queries ... I've been looking around but haven't seen the solution ... some suggest AJAX but i could figure out to adapt it here

thanks

Edited by Marc_5

3
Contributors
7
Replies
20
Views
2 Years
Discussion Span
Last Post by pixelsoul
0

interesting ... but this variable stays outside the graps of php (server side) .. i need to capture it to do a mysql query to prefill a form.

Edited by Marc_5

0

You need to send the data to the PHP script one if two ways... Either by posting to the page (form post and send the value via an input element) or use AJAX to interact with the PHP script without having to post/reload the page.

0

SO i guess using AJAX to give a vlaue to $POST sounds like the solution... anywhere you can send me to to learn about how ajax will do that.. ? seem a bit lost. Everything posted out there since to specific

0

thank you both ... nothing like going from ground up .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.