PHP
  Home arrow PHP arrow Generating Contract Numbers for Online Licenses using PHP and MySQL
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Generating Contract Numbers for Online Licenses using PHP and MySQL
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 7
    2009-04-28


    Table of Contents:
  • Generating Contract Numbers for Online Licenses using PHP and MySQL
  • Inserting generated random numbers into a MySQL database
  • Basic Form Code
  • Generate Unique Contract numbers

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Generating Contract Numbers for Online Licenses using PHP and MySQL
    ( Page 1 of 4 )

    PHP and MySQL form a powerful combination of open source technology available to any web developer. One of the increasing trends in modern web development is the generation of online contracts. E-commerce websites selling services online need automated contract generation for faster delivery of services. This article will help you learn to use this technology so you can get it working on your web site.

    One of the most common applications is issuing licenses online. In the real world, licenses are issued on paper and signed by both parties. In the online world, this can be done efficiently with an online contract which can be traced by issuing a contract number. Contract numbers are the best way to track those licenses; with every licensing agreement, there should an accompanying licensing contract.

    Simple PHP Contract Generation Script

    To understand how to generate contract numbers, let’s consider a basic example:

    <?php

    echo mt_rand(min, max);

    echo '<br />';

    ?>

    This piece of random code will generate random number between min and max. So for example, if you need to generate a random number between 10000 and 15000, the code would look like this:

    <?php

    echo mt_rand(10000, 15000);

    echo '<br />';

    ?>

    Bear in mind that 10,000 is the minimum random number that will be generated and 15,000 is the maximum random number that will be generated.

    There are a countless number of applications for a PHP random number generator script; these may include games, random number quizzes, number-based passwords, etc.

    If you've learned PHP before, you must have met the PHP random number function rand(). This is the classic random number function. In the simple random number generator script above, we are using:

    mt_rand();

    The only difference between mt_rand() and rand() is speed. The mt_rand() function is capable of processing four times faster than the old random generator script.



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT