<?php
function php_split_js_make_email($phpemail)
{
$pieces = explode("@", $phpemail);
echo '
<script type="text/javascript">
var a = "<a href=\'mailto:";
var b = "' . $pieces[0] . '";
var c = "' . $pieces[1] .'";
var d = "\' class=\'email\'>";
var e = "</a>";
document.write(a+b+"@"+c+d+b+"@"+c+e);
</script>
<noscript>Please enable JavaScript to view emails</noscript>
';
}
?>
Usage
<?php php_split_js_make_email("[email protected]"); ?>
That’s a nice way to obscure an email. I’ve always used WordPress���
antispambot
¹. But for a project outside of WP…¹http://codex.wordpress.org/Function_Reference/antispambot
Where would I put the PHP function? Inline with the html?
Will a PHP function run in my index.html?
Thanks.
nope….your page need to end with .php
@chester – you can run php in .html files, but you might also need to enable apache via .htaccess to run php in a .html with a line like this in your .htaccess file:
AddType application/x-httpd-php .html .htm
i want to a php code to detach the mail from body .. please give reply..
I actually updated this email protector and it
can be found here with a couple of new arguments (Same link as above)