Before I try and reinvent the wheel, can anyone help me with a basic routine
to hide email addresses from harvesting.
I currently use pull my page content from a db and run this ereg_replace:
$pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A
-Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
color="#0000FF" ><b>\\0</b></font></a>', $pagetext);
This simply replaces any emails within the page text with an <a> tag.
What I would like to do is replace it with:
<script language="JavaS cript">
document.write( rot13('<n
uers=\"znvy@rkn zcyr.pbz\">znvy @rknzcyr.pbz</n>'));
</script>
So, somehow I need to PHP's str_rot13() on the email addresses before the
ereg_replace. If anyone can suggest a solution I would be grateful.
Nel
to hide email addresses from harvesting.
I currently use pull my page content from a db and run this ereg_replace:
$pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A
-Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
color="#0000FF" ><b>\\0</b></font></a>', $pagetext);
This simply replaces any emails within the page text with an <a> tag.
What I would like to do is replace it with:
<script language="JavaS cript">
document.write( rot13('<n
uers=\"znvy@rkn zcyr.pbz\">znvy @rknzcyr.pbz</n>'));
</script>
So, somehow I need to PHP's str_rot13() on the email addresses before the
ereg_replace. If anyone can suggest a solution I would be grateful.
Nel
Comment