Jump to main content
URZ Workshop „Creating websites with TUCAL“
Disguising E-mail addresses
URZ Workshop „Creating websites with TUCAL“ 

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 or by telephone at .

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');
page settings in the editor

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

Examples

echo prot_mailadr('anna.normalverbraucher@s2022.tu-chemnitz.de');
echo prot_mailadr('anna.normalverbraucher@s2022.tu-chemnitz.de'1);
echo prot_mailadr('0371 / 531 12345'10);