HELP make username an email link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Smedley
Forum Newbie
Posts: 5
Joined: Tue Feb 26, 2008 10:14 am

HELP make username an email link

Post by Smedley »

Hi guys,

I'm sure this is easy for a guru so here's what I want to do. The OUTPUT of my code reads as follows:

Username: jblow
Full Name: Joe Blow

How tough to make the username (in this case 'jblow') a link to his email (that would read 'jblow@company.org')? I suppose it's just a matter of adding the '@company.org' and telling it that the field is an email link.
The existing bit of code is shown below:

echo '<b>Username:</b>';
echo '</td><td>';
echo $row['Username'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Full Name:</b>';
echo '</td><td>';
echo $row['FullName'];

Thanks so much in advance!!
Smedley
Forum Newbie
Posts: 5
Joined: Tue Feb 26, 2008 10:14 am

Re: HELP make username an email link

Post by Smedley »

BTW, the username 'jblow' can still display the same (as 'jblow'), it just needs to act as a hyperlink to his email. Hope that clarifies!

Thanks!!
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: HELP make username an email link

Post by Zoxive »

Uhh..

Code: Select all

echo '<a href="mailto:' . $row['Username'] . '@company.org">' . $row['Username'] . '</a>';
Smedley
Forum Newbie
Posts: 5
Joined: Tue Feb 26, 2008 10:14 am

Re: HELP make username an email link

Post by Smedley »

I'll take any help without regard to heaping spoonfuls of condescension :D

Tried this and it returns my page as a blank. If someone has time can you cut/paste the correct code into my provided code - Will be a good learning experience to have the side-by-side comparison...

Thanks again for sharing the knowledge!!
Post Reply