Language PHP : Hypertext Preprocessor

 Charge moyenne sur 1mn : 0.35 Charge moyenne sur 5mn : 0.33 Charge moyenne sur 15mn : 0.54


PHP

PHP is a popular general-purpose scripting language that is particularly suited for web development.

Fast, flexible and pragmatic, PHP is made for any blog or for all the most popular sites in the world.

The word PHP or programming language contained in web pages and executed on servers, they return the result directly to the client who can never see the source. Allows you to create dynamic web pages.

PHP.Net © 2001-2020 The PHP Group: Language Reference

Predefined PHP classes to make our life easier :)






Site user blocks : Account info / user rights / summary

Identify yourself

Authenticate with your ZW3B account and take advantage of member services.

Username :
Password :
  
  

Encoder un lien de type mailto

Comment-faire pour encoder un lien de type mailto.

Informations :

Dates
  • Publish : : Thursday 14 october 2004
  • Modification : Thursday 01 september 2011

Share :

P' tite fontion qui permet d'encoder un lien mailto (adresse email), pour éviter à nos utilisateurs de se faire spammer.

Script avec 12 lignes

001[php]
002 function mailCrypt($nemail)
003{
004    $encoded = bin2hex("".$nemail."");
005    $encoded = chunk_split($encoded, 2, '%');
006    $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1);
007
008    return $encoded;
009}
010
011echo mailCrypt("user@domaine.com"); 
012[/php]

on pourait faire aussi :

Script avec 24 lignes

001[php]
002function lienMail($email)
003{
004    $encoded = bin2hex("".$email."");
005    $encoded = chunk_split($encoded, 2, '%');
006    $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1);
007
008    if (eregi("@" ,$email))
009    {
010        $transforme = ereg_replace("@" ," AT " ,$email);
011    }
012    
013    if (eregi("." ,$email))
014    {
015        $transforme = ereg_replace("." ," DOT " ,$email);
016    }
017    
018    $mail = '<a href="mailto:'.$this->mailto($email).'">'.$transforme.'</a>';
019
020    return $mail;
021}
022
023echo lienMail("user@domaine.com");
024[/php]

ok :D





Translate this page with Google

Author of the page

O.Romain.Jaillet-ramey

O.Romain.Jaillet-ramey

  • Firstname : Olivier Romain Luc
  • Lastname : : Jaillet-ramey
  • Arrived on tuesday 19 october 1976 (1976/10/19 00:00)
    44 years activity !

Firefox Nighlty

Our friends from Framasoft are interested in Mozilla and asked them questions about Nightly: Firefox Night-club, free entry !






Valid XHTML 1.0 Strict CSS Valide !

ipv6 ready