-3

For starters i am fairly new at this. I am trying to figure out how to a href link my row 'inspection_files' and i have tried just about everything. Is there anybody who could help me?

<?php
$i = 0;
foreach ($result as $r) {
    echo "<tr>";
    echo "<td>" . $r['last_inspection'] . "</td><td>" . strtolower(trim(($r['inspected_by_company']))) . "</td><td>" . strtolower(trim($r['inspection_files'])) . "</td>";
    echo "</tr>";

    $i++;
}
?>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

1 Answers1

-1

Hey you can directly use <a> tag inside the <td>, just like below

echo "<td>" . $r['last_inspection'] . "</td><td>" . strtolower(trim(($r['inspected_by_company']))) . "</td><td><a href='" . strtolower(trim($r['inspection_files'])) . "'>" . strtolower(trim($r['inspection_files'])) . "</a></td>";

I hope $r['inspection_files'] this is your URL if this is not your redirect URL then just replace with your actual URL.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Gajanan Kolpuke
  • 155
  • 1
  • 1
  • 14
  • Not my downvote here, but I edited your answer to use ticks around (HTML) markup elements. Go into edit mode to see what I did. Edit: Not sure why you got a downvote though. Maybe the person can elaborate on it? – Funk Forty Niner Oct 18 '18 at 13:40