PHP Classes

File: mailto_encoder_test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Konstantinos Dafalias  >  Mailto Encoder  >  mailto_encoder_test.php  >  Download  
File: mailto_encoder_test.php
Role: Example script
Content type: text/plain
Description: Sample script
Class: Mailto Encoder
Encode email address links with character entities
Author: By
Last change:
Date: 10 years ago
Size: 1,251 bytes


Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>Mailto-Encoder test</title>
<style type="text/css">

 a.myclass {
     text-decoration: none;
     color: Olive;
     text-decoration: underline;
 body {
     background-color: #FAF0E6;
     font-family: Arial, Helvetica, sans-serif;


# Please view HTML source of the result page to see what the class does

# Only email address
$sEmail = "test@testing.gugu";

"Original mail address: $sEmail<br /><br />");

$oEncodedmail = new cMailto_encoder();

# Only email address
echo("Email address only: ".$oEncodedmail->mailto_encode($sEmail)."<br /><br />");

# Email address and link text
echo("Email address and link text: ".$oEncodedmail->mailto_encode($sEmail, "Send me an email, PLEASE!")."<br /><br />");

# Email address with style class and Params
$aParams = Array("subject"=>"Mail from my website", "body"=>"Hi! I am sending You this email because I am bored");
"Email address with style class and Params: ".$oEncodedmail->mailto_encode($sEmail, "", "myclass", $aParams)."<br /><br />");