Barcodes using PHP

IIS and PHP

Setting up ActiveBarcode for IIS and PHP

Using ActiveBarcode to display barcodes on Internet sites with IIS and PHP is very simple. A standard installation of IIS and PHP is usually sufficient.

If you have not installed PHP yet, do this first. You may install PHP manually or simply use the Microsoft Web Platform Installer.

Webplattform-Installer


Additional to IIS and PHP you need the barcode object. If you have installed ActiveBarcode, the barcode object is already installed. The Internet-license must be installed, too. You received instructions on this with your purchase. The trial version does not require a license.

Example iconThe "com_dotnet" extension of PHP must be activated!
Current versions of PHP does not have activated the COM extension by default. This extension must be activated in order to use the barcode object: Edit your php.ini file and add the line "extension = php_com_dotnet.dll" to the entries of [ExtensionList].
To use the PHP demo, copy the contents of the folder c:\program files (x86)\activebarcode$platform\ to a subfolder of the inetpub folder. E.g.: c:\inetpub\wwwroot\php-activebarcode-demo\

Now open open the URL http://localhost/php-activebarcode-demo/.
An example page will open that shows and explains how to create barcodes dynamically.

PHP Demo


How to use the barcode object with PHP

The easiest way to create barcodes dynamically is to use 'barcodeimage.php'. It's a wrapper for the barcode object so that you can create barcodes and use them as images in any html page using the HTML img tag.

'barcodeimage.php' is found in c:\program files (x86)\activebarcode\php and must be copied to a folder that is covered by IIS. (E.g. \inetpub\wwwroot\php-activebarcode-demo\)

In your html pages you use 'barcodeimage.php' with the img tag:
<img src="barcodeimage.php">
A barcode with default values will be shown:

Barcode

To define the barcode content and other attributes, you add parameters.

Example with parameters to create the specifc barcode shown below:
  <img src="barcodeimage.php?code=CODE39EXTENDED&
  text=Hello%20World!&showtext=1&rotate=90& 
  backcolor=002288&forecolor=12345&width=250&
  height=430&borderwidth=50&borderheight=25">

Barcode

More information: Parameter list for 'barcodeimage.php'.