Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,330 members, 7,826,310 topics. Date: Monday, 13 May 2024 at 12:34 PM

Php/mysql Pin And Serial Number Generation Script - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php/mysql Pin And Serial Number Generation Script (5276 Views)

How Can I Generate Pinss And Serial Number? / In Need Of Adobe Cs3 Master Collection Serial Number (2) (3) (4)

(1) (Reply) (Go Down)

Php/mysql Pin And Serial Number Generation Script by uchdollar111: 6:13pm On Nov 30, 2012
Fellow nairalanders, I greet
you all. I was asked to create a
system that generates 14
digits pin codes at random together with their unique
serial numbers. The system
will make sure that thesame
pin is not generated twice.
The idea is to create pin
numbers for customers when the customer purchases the
pin and redeems it, that pin
can never be used again. Am
using php and mysql. Please
help as I'm just starting up pogramming.
Re: Php/mysql Pin And Serial Number Generation Script by PGON(m): 6:30pm On Nov 30, 2012
Would like to help if i know what you have done already and where exactly you need help
Re: Php/mysql Pin And Serial Number Generation Script by Nobody: 6:45pm On Nov 30, 2012
That's quite a stressful but tiny piece of cake job. If i may ask? Are u anvanced in php and mysql? ...let's see what u've started and we'll help out. If u want me to do d job for u, u gotta pay bro...
Re: Php/mysql Pin And Serial Number Generation Script by uchdollar111: 8:27pm On Nov 30, 2012
I've done nothing I don't know where to start please help me
Re: Php/mysql Pin And Serial Number Generation Script by solutions247(m): 11:52pm On Nov 30, 2012
If u r sure of what you saying. Snd me a mail @ freesolutions247@gmail.com xplainin in details what d aplicatn would do..i kan giv u a clue
Re: Php/mysql Pin And Serial Number Generation Script by nairawall: 9:27am On Dec 01, 2012
To get you quickly started. Here is the idea of generating the PINs and serial numbers. Some of the questions to answer are:

1.) Are the serial number all numeric or alpha numeric?
2.) Are the PINs numeric or alpha numberic?

The first step is to build a function that gives you the ability of generating all types of random strings or number with the ability of setting exactly what type of random number or string you want.see the function below:


//Create random numbers
function generateRandomString($type = 'alnum', $len = cool
{
switch($type)
{
case 'alnum' :
case 'numeric' :
case 'nozero' :
switch ($type)
{
case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'numeric' : $pool = '0123456789';
break;
case 'nozero' : $pool = '123456789';
break;
}

$str = '';
for ($i=0; $i < $len; $i++)
{
$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
}

return $str;
break;
case 'unique' : return md5(uniqid(mt_rand()));
break;
}
}



Step 2:

You can then proceed to generate your random 14 digit PIN and serial number. Assuming you intend creating 100 PINs at a time, then you simply write a loop that runs 100 times. Here is the logic


//Create loop
$success_pins = 0;
for($i=1; $i<=100; $i++)
{
//create your PINs and serial number
$pin = generateRandomString('numeric', 14);
$serial_no = generateRandomString('numeric', 6); //Note you didn't specify the number of digit on your post

//Check if pin already exist on the database, if not insert PIN and serial number into PIN database table
//Note that the isPIN() and insertPIN() were not written here but can help you write then if you don't get the clue.

if(isPIN($pin)){ //PIN exist and ignore }
else{
insertPin($pin, $serial_no);
$success_pins = $success_pins + 1; //Keep count of successfully loaded or inserted pins.
}

//Print report.
$report = "$success_pins pin(s) successfully inserted into the PIN database table";
}


If you have any more challenges, do feel free to buzz me.
Re: Php/mysql Pin And Serial Number Generation Script by uchdollar111: 5:01pm On Dec 01, 2012
nairawall thank you very much. Solutions247 I've sent an email to you containing a detailed description of the system.
Re: Php/mysql Pin And Serial Number Generation Script by uchdollar111: 12:21am On Dec 02, 2012
Nairawall thank you very much. So far, you have talked abou the pin and serial number generation, how do i go about the redemption of the pin
Re: Php/mysql Pin And Serial Number Generation Script by talk2me006(m): 5:28pm On Dec 02, 2012
uchdollar111: Fellow nairalanders, I greet
you all. I was asked to create a
system that generates 14
digits pin codes at random together with their unique
serial numbers. The system
will make sure that thesame
pin is not generated twice.
The idea is to create pin
numbers for customers when the customer purchases the
pin and redeems it, that pin
can never be used again. Am
using php and mysql. Please
help as I'm just starting up pogramming.
I always use my software to generate my random pin no and serial no either in numeral,alphabet or mix. stop wasting your time in writing any code.
call me - 08039685053
Re: Php/mysql Pin And Serial Number Generation Script by uchdollar111: 9:02am On Dec 05, 2012
Naira wall thank you very much but I still have some questions.(1) How do I write the isPIN() and insertPIN() Fxns.(2) How to I assign a certain amount of money to each PIN. (3) How do I make the customers redeem the pin. Nairawall I will like to have your phone number, your 2go username and your email address. My phone number is 08101309222 and my email address is uchdollar@gmail.com. Nairawall pls reply to this post cos I need ur help.
Re: Php/mysql Pin And Serial Number Generation Script by nairawall: 4:43pm On Dec 05, 2012
uchdollar111,

I will do you a comprehensive reply tomorrow which will seek to provide answers to all your questions.
This is my number 08067630525.
Re: Php/mysql Pin And Serial Number Generation Script by uchdollar111: 10:42pm On Dec 05, 2012
Nairawall, I just sent you a 2go friend request pls accept it

(1) (Reply)

Please What Does This Notification From Adsense Means. / Web Academy, Ikeja, Lagos / How To Use Color Psychology To Boost Your Web Design Job

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.