You can use RandomPassword function;
<?
function RandomPassword($passlength) {
$chars = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
$chars .= “1234567890″;
$chars .= “abcdefghijklmnopqrstuvwxyz”;
$charsLength = strlen($chars);
for ($ras = 0; $ras <$passlength; $ras++) {
$number = rand(0,$charsLength-1);
$password .= $chars[$number];
}
return $password;
}
echo $RandomPassword(8);
?>
See demo
This class supplied by Gurdeep Singh. #4 of the complete list of winners of the award on January of 2008. SWF to JPEG is my favorite class on Jan 2008.
Detailed Description;
This class can be used to render an image drawn on a Flash canvas movie.
A Flash canvas movie displays a drawing area on which the user can draw a picture with brushes of different colors and and thicknesses.
When the user wants the save the drawing, the Flash movie sends the list of the brush strokes to the server.
The class receives the list brush strokes and generates a JPEG image file that represents a copy of the user drawing.
To generate random number between 0-1000 try this;
srand((double)microtime()*1000000);
echo rand(0,1000);
The above example will output something similar to:
891
The easiest way to keep spam bots away. Secure your blogs, forums, comment boxes & directories so robots cannot crack their way inside. A captcha is a logical question test used on the internet to determine whether or not the user is human. Questions should be simple enough for anyone to answer. And also this class has innovation award at PhpClasses.org.
Author : Josh Storz
Quote :
“This class can be used to perform CAPTCHA validation presenting to the users simple mathematical expressions as a sequence of animated pictures to make it difficult for robots to pass a form being validated.
It generates an animated GIF image that displays a mathematical expression of a simple operation between two random numbers, like sum, subtraction and multiplication.
The numbers and the operation are stored in session variables for posterior verification. “
Phpclasses.org is the best one of my favorite sites. Board of site has sending mails every month about popular and new classes. PostgreSQL backup class is the best for me. so i want to share this class.
This class can be used to generate backups of PostgreSQL.
It accesses a given database and generates SQL statements that can be used to recreate the database tables and the values stored on their rows. The generated SQL is stored in a given file.
The class can also restore a database from a previously generated backup by executing the SQL statements stored in a backup file.