Forums

PHP

This topic is locked

Linking an e-mail

Posted 17 Sep 2003 22:45:18
1
has voted
17 Sep 2003 22:45:18 Michal Dusik posted:
Hi!
I have a problem because I have a db of 1000 users in this format:
Name, Surname, Adress, Phone, E-mail
The field "e-mail" contain an e-mail but when I visualize the whole db in a php page, its not clickable (linked) but just listed as text. How can I make the e-mail clickable without editing each 1000 names by hand?


Thanx a lot

Miky

Replies

Replied 18 Sep 2003 07:26:44
18 Sep 2003 07:26:44 Allan Kent replied:
Hi,

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Name, Surname, Adress, Phone, E-mail
The field "e-mail" contain an e-mail but when I visualize the whole db in a php page, its not clickable (linked) but just listed as text. How can I make the e-mail clickable without editing each 1000 names by hand?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Just create a mailto: link. I'm assuming you're using a Repeat Region to display the email addresses. I'm also going to assume that your email field in the database is called simply e-mail and that your recordset is called rstUsers.

Find the bit of code that is displaying the email address, which would be something like

<pre id=code><font face=courier size=2 id=code>&lt;?php echo $row_rstUsers['e-mail']; ?&gt;</font id=code></pre id=code>

And change it to read

<pre id=code><font face=courier size=2 id=code>&lt;a href='mailto:&lt;?php echo $row_rstUsers['e-mail']; ?&gt;'&gt;&lt;?php echo $row_rstUsers['e-mail']; ?&gt;&lt;/a&gt;</font id=code></pre id=code>

Allan

Reply to this topic