UltraFREE.net

Free Internet Guide

Archive for March, 2008

Creating random passwords with PHP?

  • Filed under: PHP
Monday
Mar 3,2008

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

SWF to JPG (PHP Class)

  • Filed under: PHP
Monday
Mar 3,2008

Render Flash canvas image as JPEG

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.

Download SWF to JPG (PHP Class) | Demo | Class homepage

How do i generate random number?

  • Filed under: PHP
Monday
Mar 3,2008

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

Meta


Advertise



Add to Google Reader or Homepage Subscribe in NewsGator Online Subscribe in Rojo Add to My AOL Add to netvibes Subscribe in Bloglines

Skip to top of the page