...

View Full Version : [Help] Php Serial Generator



xxcorrosionxx
10-30-2012, 08:50 PM
I was hoping someone can take some time out to code me a php serial generator for free. I would really appreciate it.

The serial numbers should display the output like this once generated:

Company Name: Pazder

Order Number: 1382263

Serial Number: DC-387-05546-FU-194

Order Number: 214748262502306047

Key: DC-429-0209510309209

But, i would like people to be able to insert their own company name, so when the serials are generated it will show their company name along with the serial. If someone could put it in the format on how i have it displayed up top it would be much appreciated.

Kindest Regards,
xxcorrosionxx

Redcoder
10-31-2012, 12:35 AM
For the serial number....A suggestion would be to take the MD5 hash of the timestamp - time() - then take the first 15 characters of the generated hash and separate every 2 characters using hyphens. Although this increases the chances of collision, it is a viable method of generating Serial Numbers.

xxcorrosionxx
10-31-2012, 12:50 PM
For the serial number....A suggestion would be to take the MD5 hash of the timestamp - time() - then take the first 15 characters of the generated hash and separate every 2 characters using hyphens. Although this increases the chances of collision, it is a viable method of generating Serial Numbers.

Something like this, this is something i made but it isn't very good.


<!DOCTYPE html>
<html>
<head>
<title>DigiChat Serial Generator</title>
</head>
<body>
<form action="?" method="get"><b>Company Name: </b><input
type="text" name="CompanyName" /><br/>
<input type="submit" value="Generate" /> </form> <p>
<br/>
<b>Company Name:</b>
<br/><?php echo isset($_GET['CompanyName']) ? htmlspecialchars($_GET['CompanyName']) : ''; ?>
<br/>
<b>Order Numbers:</b>
<br/>
<?php
// This part is buggy, I will fix it later.
$input = array("400904015", "842922074", "614975264", "945558183", "617697462" );
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
?>
<br/>
<b>Serial Numbers:</b>
<br/>
<?php
// This part is buggy, I will fix it later.
$input = array("DC-770-06278-GH-548", "DC-591-67799-FQ-593", "DC-631-32024-GL-281", "DC-736-91659-GB-

403", "DC-590-34096-FM-230" );
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
?>
<br/>
<b>Order Numbers:</b>
<br/>
<?php
// This part is buggy, I will fix it later.
$input = array("121749811100001023", "116778905500001023", "117761126300001023", "126703411100001023",

"128687615900001023" );
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
?>
<br/>
<b>Key:</b>
<br/>
<?php
// This part is buggy, I will fix it later.
$input = array("DC-029-0000102308382", "DC-274-0000102308382", "DC-284-0000102308382", "DC-033-

0000102308382", "DC-280-0000102308382" );
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
?>
<br/>
</body>
</html>

If someone can take it and re-write it to be a cleaner version that would be awesome! Also, is their a way that when they enter in the company name the results of the serials will THEN show up? So it will just show the input box and the generate button, then when they type in a company name and then hit generate, then the rest of the serial will be displayed. like i showed in the first post?

Redcoder
10-31-2012, 06:11 PM
To a cleaner version? That means that it works but you want clean code...right? Or you just want it done better. You should probably post it in the Job and Web projects forum. You can get somebody to do it faster for you for a small fee.

Or just wait for somebody to do it all for you...just wait...just wait.

xxcorrosionxx
10-31-2012, 06:32 PM
Lol, no thanks. Got what I needed, just didn't want to do it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum