在对话框中单击按钮获取动态id


Get dynamic id on button click in dialog box

我有一些产品。我得到了用户对每个产品的反馈。当用户点击"回复"按钮进行反馈时,出现一个对话框。

现在,问题是,每次"回复"按钮打开同一id的对话框。为了确保,我在每次返回相同Id的对话框中打印Id…我想让对话框打开,但使用不同的id。

我该怎么做呢?

这样我就得到了product的id:

$get_product = "select * from product_reviwes where product_code = '$pro_code' ORDER BY user_reply_date DESC";

代码如下:

$a = strtolower($product_owner);
$b = strtolower($email);
if($a == $b){
    echo "<br>
            <small><div align='center'><a href='#login-box' class='login-window'>Reply</a></div></small>
            <hr>
            <div id='login-box' class='login-popup'>
              <a href='#' class='close'><img src='images/close_pop.png' class='btn_close' title='Close Window' alt='Close' /></a>
              <form method='post' class='signin' action='$url&ID1=$ID'>
                <fieldset class='textbox'>
                    <label class='username'>
                        <span>Please Enter Your Reply</span>
                        <input id='reply' name='reply' value='' type='text' autocomplete='on' placeholder='Please Enter Your Reply Maximum 1000 Letters' maxlength='1000'>
                    </label>
                    <br>
                    this is ID  =   $ID;//  testing to see id 
                    <br>
                    <button class='submit button1' type='submit' name='post'>Reply</button>
                </fieldset>
              </form>
            </div>";
}

如果我改变
href = ' #登录框'与
href = ' url&amp美元;ID1 = $ ID '

然后选择所需的id但是对话框没有打开

试试这个方法

<div id='login-box-<?=$ID;?>' class='login-popup'>

当点击回复按钮时显示相应的登录框div基于ID

<button class='submit button1' type='button' onclick='$("#login-box-<?=$ID;?>").show()' name='post'>Reply</button>