PHP-Logo
Druckansicht von http://www.php-homepage.de/scripts/source_61.html

PHP-Logo
[ Main Menue ]
Homepage
Downloads
Artikel
Scripts
Forum
PHP-Manual
Links
News
Freelancer
Bücher
RuDolF
Suche
Misc
Über diese Seite
Kontakt
Wunschzettel
MyGuestbook
*
[ Suche ]
*
[ Partner ]


Domain Webhosting
*
[ Partner Sites ]
Dynamic-Webpages
PHP-Center
PHP-Welt
phpUG.de
Random Link
*
[ Autoren gesucht! ]
PHP-Homepage.de sucht laufend Autoren für News und Artikel
Interesse?
*

Follow on Twitter - @phphomepage

RSS Feed blogoscoop

[Start] [Suche] [Neue Einträge

Passwort Generator

<?php
/*
* License: GNU-General Public License
* For details please refer to http://www.gnu.org/copyleft/gpl.txt
*
* Passwordgenerator, Hakan Kuecuekyilmaz <hasoco@mail.com>
* Buelent Tiknaz <cenk21@gmx.de>
* gets number of[a-z],[A-Z],[0-9],[!º$%&/()=?*]
* returns STRING
* STRING pass(INT,INT,INT,INT);
*
*/


function pass($a,$A,$num,$spec) {
// initialize the random generator
srand ((double) microtime() * 10000000);

$b = array(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z);
$B = array(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z);
$NUM = array('0','1','2','3','4','5','6','7','8','9');
$SPEC = array('!','§','$','%','&','/','(',')','=','?','*');

$D = $a + $A + $num + $spec;

for ($i = 0; $i <= $a; $i++) {
$index = array_rand($b,$a);
$pass[] = ($b[$index[$i]]);

}
for ($i = 0; $i <= $A; $i++) {
$index = array_rand($B,$A);
$pass[] = ($B[$index[$i]]);

}
for ($i = 0; $i <= $num; $i++) {
$index = array_rand($NUM,$num);
$pass[] = ($NUM[$index[$i]]);

}
for ($i = 0; $i <= $a; $i++) {
$index = array_rand($SPEC,$spec);
$pass[] = ($SPEC[$index[$i]]);

}
for ($i = 0; $i <= $D; $i++) {
$index = array_rand($pass,$D);
$pass_new .= ($pass[$index[$i]]);
}
return $pass_new;


}

?>
© Copyright 1999 - 2011 by Mark Kronsbein | Impressum | NutzungsbedingungenWeiterempfehlen | Seitenanfang
0.2895