Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Modifier with preg_replace_callback
Hello!

I'm trying to obfuscate and "linkify" mail addresses in a text with the =20=

following modifier:

function smarty_modifier_mail_escape($string)
{
return =20
preg_replace_callback("/[_a-z0-9.A-Z]+@[-a-z0-9.A-=20
Z]+/","escape_mail",$string);
}

function escape_mail($text)
{
echo "escape_mail called";//<-- for debugging purposes, to test if =
=20
the func is called
$text=3D$text[0];
for($i=3D0;$i<strlen($text);$i++)
{
$mailto.=3D"&#".ord($text[$i]).";";
}
return "<a =20
href=3D\"mailto:$mailto\">$mailto</a>";
}

The two functions are in the same file but  escape_mail doesn't get =20
called (Smarty 2.3, PHP 4.1). What am I doing wrong?

Is there another way to accomplish the obfuscation of email adresses =20
that are mingled with normal text?

With best regards

Gabriel Birke

--=20
KONTOR4_Neue Medien
Plathnerstra=DFe 5
30175 Hannover
Fax: +49 51184 48 98 99
mailto:birke@kontor4.de
http://www.kontor4.de=

Report this thread to moderator Post Follow-up to this message
Old Post
Gabriel Birke
03-19-04 06:29 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:38 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.