PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of amani   PHP Password Generate   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of password generate class usage
Class: PHP Password Generate
Generate random password text of given length
Author: By
Last change:
Date: 10 years ago
Size: 827 bytes
 

Contents

Class file image Download
<?php
 
/**
 * <name>Generate powerfull password class</name>
 * <author>Akbar Amani </author>
 * <email> amania1364@gmail.com </email>
 */
?>
<span>get password through ajax</span>
<a href="ajax.html"><b>Ajax Mode<b/></a>
<br />
<br />
<br />
<?php
include_once('PassGenerate.php');

// New the class to make Object
$PassGen = new PassGenerate();

// Set character set what we want create password from them
$AllChar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^*()_';

// Set our new password length
$PassGen->SetPassLen(15);

// Get our new generated password with $AllChar variable, notice if $AllChar be equal null, The class use default character set
$NewPass = $PassGen->GetPass($AllChar);

// echo our password
echo 'your password is: <pre>'.$NewPass.'</pre>';
?>