
Carey
|
| Posted: 02/24/2002, 5:04 AM |
|
Could someone please enlighten me on how to search a field (fldnews in my case), and whenever it sees URL's or email addresses it will replace with the proper html anchor tags.
Thanks!!!
|
|
|
 |
Nicole
|
| Posted: 02/25/2002, 5:59 AM |
|
Carey,
here is snippet of PHP code that surrounds url links with link html tags. Use the same approach for email addresses. Code goes in BeforeShow event. Note, that for Label fields, 'html' flag is to be selected.
$pos = strpos($fldnotes, "http:");
$newnotes = "";
if ($pos != "")
{
while (($fldnotes != "")&&($pos != ""))
{
$end = strpos($fldnotes, " ", $pos);
$url_link = substr($fldnotes, $pos, $end-$pos);
newnotes .= substr($fldnotes, 0, $pos). " <a href = '".$url_link."'>". $url_link. "</a> ";
$fldnotes = substr($fldnotes, $end+1);
$pos = strpos($fldnotes, "http:");
}
$fldnotes = $newnotes;
}
Where "notes" is field name. Note, I assume that url links are started with "http:", you may also search for url links started with "www."
|
|
|
 |
|

|