Disguising E-mail addresses
Extension module for protected display of e-mail addresses
This is how the spam protection on the websites of the TU Chemnitz works.
When you click on the mail address or phone number, a pop-up opens to display the complete data.
You can reach us by mail at support@… or by telephone at 0371 / 531….
Function and features of the module
E-mail addresses must not be in plain text on web pages, so that advertising mail senders cannot „collect“ e-mail addresses. To disguise email addresses (and also other data, such as phone numbers), the following PHP function can be used.
Integration of the module
In the TUCAL editor, this information is entered in the „Seiteneinstellungen (PHP)“ (page settings) text field:
require_once('php/mail.inc');
Basic structure
echo prot_mailadr(string $mail [, integer $length]);
Possible parameters
$mail
| PHP string- full e-mail address (or phone/fax number)
$length
| PHP integer [optional]- for e-mail addresses [optional]: 1 = truncate the address after the @ (default: first subdomain will be displayed)
- for phone numbers: how many characters will be displayed
Documentation: All details about the extension module
Examples
echo prot_mailadr('anna.normalverbraucher@s2022.tu-chemnitz.de');
anna.normalverbraucher@…echo prot_mailadr('anna.normalverbraucher@s2022.tu-chemnitz.de', 1);
anna.normalverbraucher@…echo prot_mailadr('0371 / 531 12345', 10);
0371 / 531…