search | index | tags | login/register

php mail encode (by damian)

function encode_email($email, $name = '', $class = '') {
    if (empty($name)) $name = $email;
    //$name = static_lib::html_uml($name);
    $email = preg_replace("/\"/","\\\"",$email);
    $class = 'class="'.$class.'"'; 
    if ($name != $email) $fullmail = "$name ";
    else $fullmail = $email;
    $old = "document.write('$name')";
    $output = "";
    for ($i=0; $i < strlen($old); $i++) {
        $output = $output . '%' . bin2hex(substr($old,$i,1));
    }
    return " // */\n // ]]>

This email address is protected from spam bots. You need JavaScript enabled to view it.

";
}



Tags:
#address #email #encode #function #javascript #js #mail #mailencode #php #protection #script #sniplet #spam

Info:
Attribute(s): Public
Created: 18.07.2012 20:00   Total Views: 347
Last Changed: 28.04.2017 09:03   Total Changes: 2
Δt = 0.039355993270874s