PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Richard Munroe   YAMC   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: YAMC
Generate Encoded mailto links to avoid harvesting
Author: By
Last change: Example showing use of static invocation of javascript method.
Date: 18 years ago
Size: 862 bytes
 

Contents

Class file image Download
<?php

include_once("class.YAMC.php") ;

//
// Need an object to get everything else to work.
//

$theMailto = new YAMC() ;

//
// Emit the javascript that will process the anchors
// and produce the mailto href. It doesn't have to
// be the first thing done.
//

$theMailto->javascript() ;

//
// A simple mailto link with the default name.
//

$theMailto->mailto("munroe@csworks.com") ;
print(
"<br />\n") ;

//
// A mailto with a subject and body.
//

$theMailto->mailto(array('to'=>'munroe@csworks.com',
            
'subject'=>'Mailto test',
            
'body'=>'Dear Dick,')) ;
print(
"<br />\n") ;

//
// A mail to with a different link.
//

$theMailto->mailto('munroe@csworks.com', 'Dick Munroe') ;
print(
"<br />\n") ;

//
// Test the non-object oriented call to javascript.
//

$js =& YAMC::javascript(FALSE) ;
var_dump($js) ;
?>