【问题标题】:making clickable text from php script从 php 脚本制作可点击的文本
【发布时间】:2014-12-05 10:24:39
【问题描述】:

我下面有一个php脚本

<?php include 'db_connector.php';
  $result = mysqli_query($con,"SELECT operation FROM contract");
   while($row = mysqli_fetch_array($result)) {
    echo $row['operation'];
    echo "<br>";
    echo "<br>";
  }
  ?> 

产生以下输出 AP事件报告

Configure & Maintain Service

Configure & Monitor SNC

Configure & Monitor Service

Report ON SNC Events

我在我的代码中使用它如下

<div class="description"><a id="openpanel"><?php include 'showall_contract.php';?></a></div>

我想知道,如何将每个列表项(即配置和维护服务)设为可点击链接?

【问题讨论】:

  • 查看 HTML 锚标记。 Here is the manual
  • 我认为您希望每个链接产生不同的结果。意味着不同的输出

标签: php sql clickable


【解决方案1】:

请将锚标签内的值回显为

<?php

include 'db_connector.php';
$result = mysqli_query($con, "SELECT operation FROM contract");
while ($row = mysqli_fetch_array($result)) {
    echo "<a href='your url' >" . $row['operation'] . "</a>";
    echo "<br>";
    echo "<br>";
}

【讨论】:

    【解决方案2】:
    echo "<a href='whatever_your_url_is'>".$row['operation']."</a>";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-25
      • 2014-02-22
      • 1970-01-01
      • 2022-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多