Login   Register  
PHP Classes
elePHPant
Icontem

File: signature.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Lopo Lencastre de Almeida  >  Signature  >  signature.php  >  Download  
File: signature.php
Role: Example script
Content type: text/plain
Description: Example of usage. Check code due to location of your PEAR packages.
Class: Signature
Generate signatures that identify the current user
Author: By
Last change: Added donation link to headers and in html output.
Date: 2010-02-23 09:32
Size: 1,543 bytes
 

Contents

Class file image Download
<?
    
/**
    * Simple and easy secure encrypted unique signature
    *
    * Basically this algorithm provides a unique signature for a specific visitor
    *
    * @requirements  PHP 5.x, PEAR Crypt HMAC, PEAR Net User Agent
    *
    * @author    Lopo Lencastre de Almeida, iPublicis - Internet Agency, Portugal <http://www.ipublicis.com>
    * @copyright Copyright 2008 Lopo Lencastre de Almeida, iPublicis - Internet Agency, Portugal
    * @version   Version 1.0, first public release
    * @license   http://opensource.org/licenses/lgpl-3.0.html GNU Lesser General Public License v3
    *
    * @package   signature sample
    *
    * @donation  http://smsh.me/7kit
    **/

    // Include Pear HMAC2 package
    /* require_once ('PEAR/Crypt/HMAC2.php'); */
    
require_once ('./Crypt/HMAC2.php');

    
// Include Pear Net_UserAgent_Detect package
    /* require_once ('PEAR/Net_UserAgent/Detect.php'); */
    
require_once ('./Net_UserAgent/Detect.php');

    
// Include class file
    
require_once 'class.signature.php';    

    
// Instantiate new signature object
    
$sign = new signature();

    
// Create new signature
    
$signature $sign->create();
?>

<html>
    <head>
        <title>Example usage of class.signature.php</title>
    </head>
  <body> 
    <h1>Your signature:</h1>
<?php     
    
// Output the value
    
echo "    <h3>".$signature."</h3>";
?>
  <small>Help us. <a href="http://smsh.me/7kit">Donate now</a>. Anything will be welcomed!</small>
  </body>
</html>