<?php

	class rndPass{
	var $vals;           
	var $PasswordLength;   
		function rndPass($passLen){ 
		$this->vals = "ABCDEFGHIJKLMNOPQRSTUVWXYZabchefghjkmnpqrstuvwxyz0123456789";   
		$this->PasswordLength = $passLen;
		}
		function PassGen(){
			if($this->PasswordLength > 4){ 
			$i = 0;
			$password = "";
				while (strlen($password) < $this->PasswordLength) {
				mt_getrandmax();  
				$num = rand() % strlen($this->vals);
				$tmp = substr($this->vals, $num+4, 1);
				$password = $password . $tmp;
				$tmp =""; 
				}
			return $password ;  
			}
		}
	}
?>