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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.