PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jon Pulice   JPPassClass   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Of Generator
Class: JPPassClass
Generate random text from multiple character sets
Author: By
Last change:
Date: 18 years ago
Size: 1,095 bytes
 

Contents

Class file image Download
<?php

include "pass.class.php"; //Include File
echo "<pre>"; //Nice Formatting

$pass = new PassGen; // Initiate the object

$pass->Type = 'letter'; // Set the type of generator ( letter or word )

// Array of words [WORD Type Only]
$pass->Words = array('these','words','will','part','that','used','number','length');

$pass->Ucase = true; // Use Upper Case Letters? [LETTER Type Only]
$pass->Lcase = true; // Use Lower Case Letters? [LETTER Type Only]
$pass->Nums = true; // Use Numbers? [LETTER Type Only]
$pass->Other = "!@#$%*"; // Other Characters Can be Used? leave blank for none [LETTER Type Only]
$pass->Len = 10; // Lenght Of Generated String [LETTER] >OR< Number of words chosen [WORD]
$pass->ForceLen = true; // Should we trim the string after generation to the specified lenght? [WORD Type Only]

//Print the first password
echo $pass->Generate(); echo "<br>";

// CHANGE TO WORd TYPE
$pass->Type = 'word';
echo
$pass->Generate(); echo "<br>";

// DISABLE FORCE LENGTH
$pass->ForceLen = false;
echo
$pass->Generate(); echo "<br>";

?>