link on other field name
Posted: Tue Jul 29, 2008 1:28 am
when i print data from my database, it prints NAME, ADD, etc. the if there is an email and web it print it too. the code looks like this for the if:
so it's printing a new line on the output. what i want is instead of a new line, the NAME field becomes a clickable link to of the site. am i making sense? is it possible? some help please.
Code: Select all
if (isset($row["Web"]) && strcasecmp($row["Web"],""))
{
echo "<tr><td width=425>
<font size=2 color=#000000>";
if (strpos($row['Web']," ") !== FALSE)
{
$Web = explode(" ",$row['Web']);
foreach ($Web as $Web)
echo "<a target=_blank href='{$Web}'>{$Web}</a> ";
}
else
{
echo "<a target=_blank href='{$row['Web']}'>{$row['Web']}</a></td></tr>";