简体   繁体   中英

making clickable text from php script

I have a php script below

<?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>";
  }
  ?> 

That produces the following output Report on AP Events

Configure & Maintain Service

Configure & Monitor SNC

Configure & Monitor Service

Report ON SNC Events

Am using it in my code as follows

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

I would like to know, how can I make each list item (ie Configure & Maintain Service) as a clickable link?

Please echo the values inside anchor tag as

<?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>";
}
echo "<a href='whatever_your_url_is'>".$row['operation']."</a>";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM