When choosing bar code reader, one should consider what types of bar codes will be read with it. Appended character ENTER (or CRLF) emulates pressing the key ENTER causing instant submission of the HTML form: For example, if decoded bar code is '12345AB', then computer will receive '12345AB ENTER'. By default, most of bar code readers will append extra special character to decoded bar code string called CRLF (ENTER). Just before reading the bar code, proper input element, such as INPUT TEXT FIELD must be focused (mouse cursor is inside of the input field).once focused, start reading the codewhen the code is recognized (bar code reader usually shortly beeps), it is send to the focused input field. Thus to catch received bar code string, following must be done: With PHP (and any other web programming language) the string will be placed into focused input HTML element in browser.
The trick is to know how to catch that received string. This article uses only PHP since all tests have been done with PHP applications.īar code reader is a hardware pluggable into computer that sends decoded bar code strings into computer.
The usage of bar code scanners described in this article are in the same way applicable to any web programming language, such as ASP, Python or Perl. Connecting manual barcode reader to the computer via USB significantly extends usability of PHP (or any other web programming language) into tasks involving document and product management, like finding a book records in the database or listing all bills for a particular customer.įollowing sections briefly describe process of connecting and using manual bar code reader with PHP. PHP can be easily utilized for reading bar codes printed on paper documents.