|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
PIN NUMBER GENERATION
i need an algorthm or a script to help with PIN no generation
glad to hear from you |
|
#2
|
|||
|
|||
|
RE: PIN NUMBER GENERATION
<?
//function creates random four digit PIN function createPin() { $i = 0; srand((double)microtime()*1000000); $k = 1; while ($i < 4) { $var = rand(1,9); $pin = $pin + ($var * $k); $k = $k * 10; $i++; } return $pin } ?> |
|
#3
|
|||
|
|||
|
RE: PIN NUMBER GENERATION
Oh and just to be picky, "PIN number" is technically incorrect as the "N" in PIN stands for number anyway. ;)
~MKK |
|
#4
|
|||
|
|||
|
RE: PIN NUMBER GENERATION
i really appreciate your response and thanks for your correction
i would appreciate add a module that stores the number generated in a database |
|
#5
|
|||
|
|||
|
RE: PIN NUMBER GENERATION
Well I would need to know the set up of your database table for that, but it would be something simple like:
<? //function creates random four digit PIN function createPin() { $i = 0; srand((double)microtime()*1000000); $k = 1; while ($i < 4) { $var = rand(1,9); $pin = $pin + ($var * $k); $k = $k * 10; $i++; } //add database connect here $sql = "INSERT INTO pins (`pin`) VALUES ('$pin');"; mysql_query($sql); } ?> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > PIN NUMBER GENERATION |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|