获得MySQL的数据来引导模式模式、数据、MySQL

2023-09-10 20:22:30 作者:念你成疾

我在使用PHP循环呼应我的网页的用户列表。名称的链接看起来是这样。

I have a list of users on my web page echoed using a PHP loop. The names are links look like this.

<a href="user.php?user={$user['id']}">{$user['username']}</a>

所以,当我点击每一个用户,我采取了 user.php的页。

user.php的显示基于查询参数 $用户['身份证'] 在每个用户的信息网址。使用 $ _ GET ['身份证'] 方法。

user.php displays each user's information based on the query parameter $user['id'] in the URL. Using $_GET['id'] method.

所以,这就是目前的情况下,我有。

So, that's the current situation I have.

我现在想要做的是,在显示用户的信息 仿真模型

所以,我怎么能得到那个查询参数到引导模式。而这样做的PHP程序来获得相同的功能?

So, how could I get that query parameter into the Bootstrap model. And do the same PHP processes to get the same functionality ?

推荐答案

如果你有谷歌与之相关的这种结果,你可以得到一些。

If you have google this you can get number of results related to it.

下面是code似乎是从对这个问题有一个passing-data-to-a-bootstrap-modal

Here is code seems to be referred from one of this question passing-data-to-a-bootstrap-modal

HTML

<a data-toggle="modal" data-id="ISBN564541" title="Add this item" class="open-AddBookDialog btn btn-primary" href="#addBookDialog">test</a>

<div class="modal hide" id="addBookDialog">
 <div class="modal-header">
    <button class="close" data-dismiss="modal">×</button>
    <h3>Modal header</h3>
  </div>
    <div class="modal-body">
        <p>some content</p>
        <input type="text" name="bookId" id="bookId" value=""/>
    </div>
</div>

Javascript的

$(document).ready(function () {
    $(".open-AddBookDialog").click(function () {
        $('#bookId').val($(this).data('id'));
        $('#addBookDialog').modal('show');
    });
});