PHP Classes

File: ppRandPass.example.php

Recommend this page to a friend!
  Classes of Chris Jeffries   PHP Generate Memorable Password   ppRandPass.example.php   Download  
File: ppRandPass.example.php
Role: Example script
Content type: text/plain
Description: ppRandPass example
Class: PHP Generate Memorable Password
Generate random passwords from words of a RSS feed
Author: By
Last change:
Date: 7 years ago
Size: 919 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML>
<head>
<title>ppRandPass example</title>
</head>
<body>
<h1>ppRandPass example</h1>
<?php
include ('ppRandPass.class.php');
$oPass = new ppRandPass();
$oPass->url = 'http://feeds.bbci.co.uk/news/world/rss.xml#';
                          
//The url of a constantly changing RSS feed
//The remaining properties need not be set if you are happy with the defaults
$oPass->minlength = 4; //Only words of 4 letters or more chosed (default is 5)
$oPass->maxlength = 6; //Only words of 6 letters or less chosen (defualt is 8)
$oPass->numwords = 3; //Three words randomly picked from list (default is 2)
$oPass->discard_front = 2; //The first two words retrieved will not be used (default is 0)
$oPass->discard_back = 3; //The last three words retrieved will not be used (default is 0)

echo "Randomly generated password:<b> {$oPass->password} </b>";
?>
</body>
</html>