PHP Classes

File: passmail.php

Recommend this page to a friend!
  Classes of Pierre FAUQUE   Clear MBox Class   passmail.php   Download  
File: passmail.php
Role: Auxiliary script
Content type: text/plain
Description: Script to generate a pass code to put in the subject
Class: Clear MBox Class
Clean mailbox from spam and unauthorized messages
Author: By
Last change:
Date: 17 years ago
Size: 1,516 bytes
 

Contents

Class file image Download
<?
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// may 2006. Pierre FAUQUE, pierre@fauque.net
// Generate a random pass code for the current month
// It have to be present anywhere in the subject of the message
// example: 'Subject: [SL0SBwUlQ0] I need help about PHP classes.'
// or: 'Subject: Spams are really exasperating (SL0SBwUlQ0)'
// In a page about you, you can have :
// require("passmail.php");
// echo "pass mail: " . passmail() . "<br/>";
// to have a text such as : 'pass mail: SL0SBwUlQ0'
// See example at http://www.fr-webdev.net/index.php?p=pierre.php
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function passmail() {
   
$mcoefs[1] = array(94571,'unSal4b5MutXV');
   
$mcoefs[2] = array(59618,'BQytzbPJ6Z9X3');
   
$mcoefs[3] = array(98716,'1JBdxceGfs28r');
   
$mcoefs[4] = array(86497,'0ELBlSQ1wUtVj');
   
$mcoefs[5] = array(73441,'gu6qYsxYFh38l');
   
$mcoefs[6] = array(90031,'0V6Mkm22m7VPk');
   
$mcoefs[7] = array(76543,'psd3f6vuEarwK');
   
$mcoefs[8] = array(59835,'g1nXrCwJPKEqF');
   
$mcoefs[9] = array(81107,'41hA5Y2r80wmN');
   
$mcoefs[10] = array(71053,'Q4DoOW81lMTEQ');
   
$mcoefs[11] = array(69039,'DBVN40mTD21vn');
   
$mcoefs[12] = array(90102,'V1kDEXBh1O0vJ');

   
$annee = date("Y"); $mois = date("m");
   
$code = $mcoefs[($mois*1)][0] * $annee * 3;
   
$pass = "";
    for(
$n=0; $n<=strlen($code); $n++) {
      
$num = substr($code,$n,1);
      
$pass.=substr($mcoefs[($mois*1)][1],$num,1);
    }
    return
$pass;
}
?>