Hi folks!

Im running this forum for Flash users and I have created it in Flash. Now,
I've got this little problem... If a users writes a URL like
http://www.test.com, the url becomes clickable thanks to the code below.

$text = str_replace("<", "&lt;", $text);
$text = str_replace(">", "&gt;", $text);
$text = str_replace("www.", "http://www.";, $text);
$text = str_replace("http://http://";, "http://";, $text);
$text = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
"<u><a href=\"\\1://\\2\\3\" target=\"_blank\">\\1://\\2\\3</a></u>",
$text =
eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "<u><a
href=\"mailto:\\1\";>\\1</a></u>", $text);
$text = urlencode($text);

Everything works just fine, until someone writes <a
href="http://www.test.com";>http://www.test.com</a>. The output then becomes
<a href="<a href="http://www.test.com";

Does anyone have a solution for this?


Anders Henke

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to