Adding a barcode to a form e-mail
Sometimes it's important to add a unique identifier to the form response, for example travel or event tickets. In this recipe we will look at generating a "random" identifier and adding it to the form e-mail as a scannable barcode.
Getting ready
We're going to need a simple form. Our newsletter form will be perfect although we'll be adding to the code in the Form HTML box.
We'll need a simple function to create the "random identifier" which we will see shortly.
Lastly we"ll need code to generate a barcode. Rather than taking time reinventing this particular wheel, we're going to use a PHP program created by Charles J Scheffold and made available for use or download from http://www.sid6581.net/cs/php-scripts/barcode/.
How to do it...
1. First, grab a copy of the
barcode.php
file from sid6581.net.2. We'll need to make this file accessible to our form. So let's create a new folder inside the ChronoForms front-end folder.
You'll probably need to use an FTP client...