Jump to content


Display name as an email link

  • Please log in to reply
2 replies to this topic

#1 gk20

  • Members
  • PipPip
  • Member
  • 14 posts

Posted 16 March 2006 - 04:40 PM

I'm outputting a user's name and contact email address
eg. Username: adminiistrator
Email: example@domain.com

Instead I would prefer to just have the user's username as a link to their email?
How is this possible?
Or perhaps as a link so that a popup will appear with users email and phone number??

I tried the link something like this -
<a href="mailto:$email">$user</a>
where $email is the result of a query - $email = $row['Email'] and
$user is similar - $user = $row['username'];

Ideally id like to see both options above to see which one looks best, but if i could get help
with either that would be great?

#2 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 16 March 2006 - 05:10 PM

echo("<a href=\"mailto:$email\">$user</a>");

That should work as long as the values are set correctly :)
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 kenrbnsn

  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 16 March 2006 - 05:15 PM

Or you could use:
echo '<a href="mailto:' . $email . '">' . $user . '</a>';

Which does the same thing, but is easier to read


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users