Jump to content

link inside an echo table?


flemingmike

Recommended Posts

hello,  im trying to add a hyperlink that launches in a new window to the following (in the last column)  any ideas?

 

  echo "<tr>";
  echo "<td align='center'>" . $row["ID"] . "</td>";
  echo "<td align='center'>" . $row["Name"] . "</td>";
  echo "<td align='center'>" . $row["jobNO"] . "</td>";
  echo "<td align='center'>" . $epn . "</td>";
  echo "<td align='center'>" . $cname . "</td>";
  echo "<td align='center'>" . $cadd . "</td>";  //want to add a hyperlink here
  echo "</tr>";
  }
echo "</table>";


}

Link to comment
Share on other sites

I'm sorry If this is incorrect, I'm only trying to help.

I've done something similar to this and I coded it like this:

	echo "<table width='80%'>";
	while ($row = mysql_fetch_assoc($album))
	{
		echo "
		<tr>
			<td>
			<img src='".$row['cover']."' width='100' height='100'
			</td>
			<td>
			<b><a href='viewalbum.php?album=".$row['$id']."'>".$row['name']."</a></b><br>
			".$row['decription']."<br>
			".$row['count']." items<br>
			<a href='deletealbum.php?album=".$row['id']."'>Delete</a>
			</td>
		</tr>
		";
	}
	echo "</table>";

 

so for your code it might be like this?

<?php
	echo "<table width='80%'>";
	while ($row = mysql_fetch_assoc($database))
	{
		echo "
		<tr>
<td align='center'>" . $row["ID"] . "</td>
<td align='center'>" . $row["Name"] . "</td>
<td align='center'>" . $row["jobNO"] . "</td>
<td align='center'>" . $epn . "</td>
<td align='center'>" . $cname . "</td>
<a href='http://mapof.it/".$cadd."'>$cadd</a>
			</td>
		</tr>
		";
	}
	echo "</table>";
?>

 

Ignore me if I'm talking rubbish.  :shy:

Link to comment
Share on other sites

Try This

 

<?php

 

echo "<tr>";

  echo "<td align='center'>" . $row["ID"] . "</td>";

  echo "<td align='center'>" . $row["Name"] . "</td>";

  echo "<td align='center'>" . $row["jobNO"] . "</td>";

  echo "<td align='center'>" . $epn . "</td>";

  echo "<td align='center'>" . $cname . "</td>";

  echo "<td align='center'><a href=\"link.php?id=['$link']\">' . $cadd . '</a></td>";  //want to add a hyperlink here

  echo "</tr>";

 

echo "</table>";

 

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.