1.   Republican DRM PHP Scripts

If you intend to sell your software on-line, you will need a way for your customers to purchase and obtain a license key for your product. The best way to do this is to integrate the generation of license keys with online payments.

To do this you will need a server side script capable of generating license keys.

 

The website http://hello_world.starkieenterprises.com is an example of how to integrate license management with online software software sales. When you purchase a master key for republican DRM you obtain all of the HTML, PHP scripts and SQL schemas from this site. This site can be used as a starting template for you own website. Alternatively you can commission Starkie Enterprises to build your site for you by contacting mailto:sales@starkieenterprises.com.

1.1.                    Design Philosophy.

This “Hello World” website has been created with the philosphopy of separating the service logic from the presentation. To do this nearly all of the PHP scripts hand over control to another HTML script after they have done their processing. This  enables you to use any web-site builder software that you like to design the presentation of the website.

2.   The RepublicanDRM PHP API.

There is a single PHP file “republican_drm.php” that contains the code to generate license keys for your customers. This code is obfuscated and your software license agreement does not permit you to modify or reverse engineer this file. In addition this file cannot distributed to others. You are however permitted to modify all other scripts and pages in the package.

 

The file “republican_drm.php” contains a single un-obfuscated function mk_license_key, with the following signature.

 

function mk_license_key(

    $trial_key, $node_locking, $host_id_str, $license_type, $num_days,

    $start_day, $start_month, $start_year, $endday, $endmonth, $endyear,

    $feature

) ;

 

The meaning of these parameters are as follows.

Parameter

 

$trial_key

Your masterkey.

 $node_locking

Set to either “any_host” or “node_locked”

 $host_id_str

The MAC address of the host on which the license is to run if $node_locking==$node_locked.

 $license_type

Set to either “TRIAL”,”DURATION”,

“START_END”, or “PERMANENT”

 $num_days

The number of days that the license will last for if $license_type ==“TRIAL” is selected.

$start_day

The day of the month that the license will start from if $license_type ==“TRIAL” is selected.

$start_month

The month that the license will start from if $license_type ==“TRIAL” is selected.

$start_year

The year that the license will start from if $license_type ==“TRIAL” is selected.

$endday

The day of the month that the license will end on if $license_type ==“TRIAL” is selected.

 $endmonth

The month that the license will end on if $license_type ==“TRIAL” is selected.

 $endyear

The year that the license will end on if $license_type ==“TRIAL” is selected.

  $feature

An user defined integer that can be stored in the license key and retrieved and used by your software.

 

This function returns a string which is either

1.      A valid license key or

2.      Begins with the characters “ERR” and contains a text error message.

3.   The “Hello World” Sample Web-Site

3.1.                    To Install the Sample Web-Site

  1. Download the PHP tarball using the details in the email that contains the master_key that you have purchased.
  2. Unzip the tarball to a directory on your computer.
  3. Create a database on your web server database, for instance create a MySQL database using phpMyAdmin.
  4. Import the SQL schema contained in the file hello_world.sq into your database.
  5. Modify the script config.php with the appropriate details such as your database name
  6. Ftp the entire contents of the hello_world directory to your website.

3.2.                    To Customize the Sample Website.

It is recommended that you use a third party HTML authoring tool to customize this web site, such as the Yahoo Site-Builder software. 

Apart from altering modifying the web pages to suit your company image, and adding your own software, you will need to change the master_key in config.php to the master_key you have purchased from Starkie Enterprises.

3.3.                    To Integrate the Sample Site with PayPal Instant Payment Notification

Firstly you need to sign up with PayPal at http://www.paypal.com to become a PayPal merchant. Then activate Instant Payment Notification on your PayPal account, and the add Buy Now Buttons to your website. More detail on how to do this is given below.

Activate Instant Payment Notification

Once you have become a merchant, activate Instance Payment notification as follows. Log into the PayPal web site and perform the following steps.

 

The IPN script provided is the simplest IPN script possible. You might want to customize it to store more detail in your database, as well perform more checks of the incoming data. For instance the script IPN.php does not examine the payment amount.

Add Buy Now Buttons to your Site

Construct a Buy Now button and place it on the page buynow.html instead of the form. Some web authoring packages allow you to create BuyNow buttons from within them. Alternatively you can construct them on the PayPal site as follows.

·        Click Merchant Tools

·        Click the Buy Now Buttons link

·        Enter the details of the item you would like to sell. To add more details such as your logo, postage fees, item colour, item size, click Add More Options and enter the details

·        Click “Add More Options”.

·        Under “Customise Your Buyer's Experience” set the Successful payment URL to the page “thankyou.php” on your website.

4.   Additional Information

If you have any more questions please contact mailto:support@starkieenterprises.com.