PHP Applications
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Applications

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old February 11th, 2007, 05:36 PM
tiwex tiwex is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 tiwex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PIN NUMBER GENERATION

i need an algorthm or a script to help with PIN no generation
glad to hear from you

Reply With Quote
  #2  
Old February 11th, 2007, 09:32 PM
marblekittykat marblekittykat is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 41 marblekittykat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 7 sec
Reputation Power: 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
}
?>

Reply With Quote
  #3  
Old February 15th, 2007, 05:17 PM
marblekittykat marblekittykat is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 41 marblekittykat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 7 sec
Reputation Power: 2
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

Reply With Quote
  #4  
Old February 26th, 2007, 06:20 PM
tiwex tiwex is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 tiwex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #5  
Old February 27th, 2007, 08:57 AM
marblekittykat marblekittykat is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 41 marblekittykat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 7 sec
Reputation Power: 2
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);
}
?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Applications > PIN NUMBER GENERATION


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway