【问题标题】:How do I pass the php variable through the href of the dropdown如何通过下拉列表的href传递php变量
【发布时间】:2019-11-09 03:25:38
【问题描述】:

我正在从搜索栏中获取电子邮件并将其存储在 $first 变量中。后来我想让这个变量通过 href=cn.php 属性传递。我该怎么做?另请注意,我在这里使用的是引导程序,但跳过了包含文本。

<?php
$first = $_GET['email'];
?>
<!doctype html>
<html lang="en">
<div class="dropdown text-center">
<br><br>
<br><br>
<button type="button" class="col-4 btn btn-primary dropdown-toggle" data- 
toggle="dropdown">Select the Subject</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="CN.php?email=' . $first . '">Computer 
Networks</a>
</div>
</div>
</body> 
</html>

【问题讨论】:

    标签: php html href dropdown


    【解决方案1】:

    你的代码看起来像-

    <?php
    $first = $_GET['email'];
    ?>
    <!doctype html>
    <html lang="en">
    <div class="dropdown text-center">
    <br><br>
    <br><br>
    <button type="button" class="col-4 btn btn-primary dropdown-toggle" data- 
    toggle="dropdown">Select the Subject</button>
    <div class="dropdown-menu">
    <a class="dropdown-item" href="CN.php?email=<?php echo $first;?>">Computer 
    Networks</a>
    </div>
    </div>
    </body> 
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-31
      • 2016-09-30
      • 1970-01-01
      • 2011-08-13
      相关资源
      最近更新 更多