A part of the script parses text to replace emails, with email-links. That works. But I would like to embed a email-harvester-blocker by decoding the emails, using a function. If the user clicks an email, he/shes is sendt to email.php that decodes the mail and so on...
I have these in the script...
Code: Select all
<?php
$patterns[] = "#\[email\](.*?)\[/email\]#si";
$replacements[] = '<a href="mailto:\1">\1</a>';
$patterns[] = "#\[email=(.*?){1}(.*?)\](.*?)\[/email\]#si";
$replacements[] = '<a href="mailto:\1\2">\3</a>';
$message = preg_replace($patterns, $replacements, $message);
?>Code: Select all
<?php
// something like this, tho the below obviously wont work...
$patterns[] = "#\[email=(.*?){1}(.*?)\](.*?)\[/email\]#si";
$replacements[] = '<a href="email.php?mail='.mailencode(\\1\\2).'">\3</a>';
//^--- edited the \1\2 doesn't show right in this snippet for some reason...
?>