while($nt = mysql_fetch_array($rt)){//adds all the values to the table
$sent_mail .= "<tr>";
$sent_mail .= "<td>".$nt['recipient']."</td>\n";
$sent_mail .= "<td>".$nt['subject']." </td>\n";
$sent_mail .= "<td>".$nt['sent_time']."</td>\n";
$sent_mail .= "<td>".$nt['message']." </td>\n";
$sent_mail .= "</tr>";
}
adding links to text
Page 1 of 12 Replies - 163 Views - Last Post: 12 March 2012 - 07:34 PM
#1
adding links to text
Posted 12 March 2012 - 06:44 PM
i have a mail page on my site and im looking to make it so if anyone adds a link in there mail they send that it is a clickable link on the other end how would i do this?
Replies To: adding links to text
#2
Re: adding links to text
Posted 12 March 2012 - 07:23 PM
You can just use an anchor:
<a href="mailto:youremailaddress">Email Me</a>
#3
Re: adding links to text
Posted 12 March 2012 - 07:34 PM
So as I understand your post you want the links in
I am not to sure if your talking about sending emails, or internal messages in your own application. But if your talking about emails then bear in mind that you have send them in HTML, and not plain-text if you want clickable links supported.
You will want to run a replace function on your
This function should do the trick.
Just going to note right away that I found this function on totallyphp.co.uk..
$nt['message']to be clickable.
I am not to sure if your talking about sending emails, or internal messages in your own application. But if your talking about emails then bear in mind that you have send them in HTML, and not plain-text if you want clickable links supported.
You will want to run a replace function on your
$nt['message']and possibly
$nt['subject']
This function should do the trick.
function makeClickableLinks($text) {
$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'<a href="\\1">\\1</a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'\\1<a href="http://\\2">\\2</a>', $text);
$text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',
'<a href="mailto:\\1">\\1</a>', $text);
return $text;
}
Just going to note right away that I found this function on totallyphp.co.uk..
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|