PHP-从另一个页面打开模式内容并传递变量

PHP-从另一个页面打开模式内容并传递变量,php,bootstrap-modal,Php,Bootstrap Modal,我试图在一个名为stores_list.php的页面中打开一个模式,该页面由另一个名为admin_store_view.php的页面中的数据填充。我需要将一个变量传递给admin_store_view.php,但由于某些原因,我不知道如何实现这一点 在stores_list.php中,我有以下代码行 <td> <a href='admin_store_view.php' class='dt_link_text ajax_forms' data-id='$store_id1'

我试图在一个名为stores_list.php的页面中打开一个模式,该页面由另一个名为admin_store_view.php的页面中的数据填充。我需要将一个变量传递给admin_store_view.php,但由于某些原因,我不知道如何实现这一点

在stores_list.php中,我有以下代码行

<td> <a href='admin_store_view.php' class='dt_link_text ajax_forms' data-id='$store_id1'  data-target='#testModal' data-toggle='modal'> $store_name </span></td>
但它似乎什么也没做。在这之后,我有了模态的其余代码,除了$store_id变量为0,我无法从查询中获得正确的结果之外,它似乎工作得很好


当模态打开时,为什么变量不更新

向您在
href
中引用的页面添加查询字符串,如下所示

<td><a href='admin_store_view.php?id=<?php echo $store_id1;?>'  data-id='$store_id1'  data-target='#testModal' data-toggle='modal'> $store_name</td>
试试这个
而不是从
数据id传递
通过
url传递

如下

<td> <a href="'admin_store_view.php?id='.$store_id1.'" class='dt_link_text ajax_forms'> $store_name </span></td>
$store\u name

使用
数据id
无法获取id的值。当您使用
GET
方法时,您应该在URL中附加id的值

<a href="admin_store_view.php?id=<?=$store_id1;?>">$store_name</a>

同时也别忘了把收尾标签放好

<td> <a href="admin_store_view.php?id=<?=$store_id1;?>" class='dt_link_text ajax_forms' data-id='$store_id1'  data-target='#testModal' data-toggle='modal'> $store_name </a></td>


这确实有效。我以前试过,但它给了我一个错误,不知道为什么。我想我可能使用了而不是标签,这可能导致了一个问题。谢谢!:)它现在确实起作用了,以前我试过,但我想我的标签不正确。现在一切都好了:)
<a href="admin_store_view.php?id=<?=$store_id1;?>">$store_name</a>
<td> <a href="admin_store_view.php?id=<?=$store_id1;?>" class='dt_link_text ajax_forms' data-id='$store_id1'  data-target='#testModal' data-toggle='modal'> $store_name </a></td>