Hi all,
I have a table that contains email addresses. In my PHP file, I want the email to show up as a <a href="mailtođemail)"> and the link to be "Email", clickable only if the record contains an email address.
Here is what the php script looks like.
$result = mysql_query("SELECT * FROM membres ORDER BY nom ASC",$db);
echo "<table border=1 cellpadding=5 align=center>\n";
echo "<tr><td><h3>Prénom</h3></td><td><h3>Nom</h3></td><td><h3>Adresse</h3></td><td><h3>Téléphone</h3></td><td><h3>Fréquence</h3></td><td><h3>Email</h3></td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td nowrap>%s</td><td nowrap>%s</td><td nowrap>%s</td><td nowrap>%s</td><td nowrap>%s</td><td nowrap><a href=\"mailto:%s\">%s</a></td></tr>\n", $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6]);
}
echo "</table>\n";
?>
Thanks in advance for your help.