Forum Moderators: coopster

Message Too Old, No Replies

Mailto:?

linking email in php

         

jhardwick

2:56 pm on Sep 9, 2007 (gmt 0)

10+ Year Member



So i am trying to add a mailto link from my mysql database below
$email = 'email_address'; it should display the email address and attach a mailto: to it.

Any ideas?

[php]
echo "<TABLE cellspacing=\"4\" cellpadding=\"5\">";
while ($row = mysql_fetch_assoc($result)) {

$email = 'email_address';
$mailto = '<a href="mailto:'.$email.'" target="_blank">'.$email.'</a>';

//echo "<TD align=\"left\" valign=\"top\" <span class=\"style3\">"$mailto;
//echo '<td align="left" valign="top"><span class="style3">'.$mailto;

echo "<TR>";
echo $row["name"];
echo "<br/>";
echo "<TD align=\"left\" valign=\"top\" <span class=\"style3\">".$mailto;
echo "<br/>";
echo "<align=\"left\" valign=\"top\" <span class=\"style3\">".$row["body"]."</TD>";
echo "</TR>";

}

echo "</TABLE>";
[/php]

eelixduppy

3:40 pm on Sep 9, 2007 (gmt 0)



Welcome to WebmasterWorld!

It should look something like this:


$email = $row['email_address'];

Just remember to use the name of the column in the table if it is not email_address.