gk20 Posted March 16, 2006 Share Posted March 16, 2006 I'm outputting a user's name and contact email address eg. Username: adminiistrator Email: [email protected]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 helpwith either that would be great?Thanks!!!!! Link to comment https://forums.phpfreaks.com/topic/5092-display-name-as-an-email-link/ Share on other sites More sharing options...
shocker-z Posted March 16, 2006 Share Posted March 16, 2006 useecho("<a href=\"mailto:$email\">$user</a>");That should work as long as the values are set correctly :) Link to comment https://forums.phpfreaks.com/topic/5092-display-name-as-an-email-link/#findComment-18040 Share on other sites More sharing options...
kenrbnsn Posted March 16, 2006 Share Posted March 16, 2006 Or you could use:[code]<?phpecho '<a href="mailto:' . $email . '">' . $user . '</a>';/>[/code]Which does the same thing, but is easier to readKen Link to comment https://forums.phpfreaks.com/topic/5092-display-name-as-an-email-link/#findComment-18041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.