| Index
» Projekty
» phpMyEdit
» Fórum
» random pass |
 |
Pilly
Založený: 13.10.2006
Príspevky: 3
Zaslal: 2006-10-13 17:03
Návrat hore
Odpovedať s citátom
|
Hi,
I have a field in my database called pass... what I'd like to do is on add automatically insert generate a unique random password to the field.
in php i would use
$token = sha1(uniqid(mt_rand(), true));
$result = substr($token, 0, 4).'-'.
substr($token, 4, 4).'-'.
substr($token, 8, 4).'-'.
substr($token, 16, 4).'-'.
substr($token, 20, 12);
$new = substr($result, 0, 9);
Is there anyway to use this code?
|
Pilly
Založený: 13.10.2006
Príspevky: 3
Zaslal: 2006-10-17 09:50
Návrat hore
Odpovedať s citátom
|
I used the above code then
$opts['fdd']['pass'] = array(
'name' => 'Pass',
'select' => 'T',
'maxlen' => 9,
'values' => array($token_new),
'options' => 'VLA',
'input' => 'P',
'sort' => true
);
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|