PHP and Barcode Scanners

For actually creating barcodes in PHP, you might want to have a look at:

http://www.mribti.com/barcode/

http://www.ashberg.de/php-barcode/


Usually, these scanners are equivalent to a keyboard input, so you just select the appropriate input point on the web page, scan, and then submit the form.


I just did this for an application. It's actually simple. The scanner is just another input method and is, in fact, similar to a keyboard. When you scan the barcode the data is decoded by the scanner and sent to whatever application is waiting to receive it. In the case of a web-based application it would be a form, most likely with a textarea with focus. The data would then populate the textarea just as if someone had typed the barcode's data into it. The form is then submitted and processed normally.

Just make sure the textarea has focus or else the data will go either nowhere or to wherever focus is (which may be another form field or the address bar).

I have yet to figure how how to get the form to auto-submit upon the entry of the barcode data as the scanner does not send event information (i.e. submit) and special characters such as tab (\t) do not seem to work. (If anyone knows how to accomplish this I am very interested in knowing how it can be done).

Tags:

Php