Tsundoku
Tsundoku

Reputation: 9408

Getting data from a Barcode Scanner using PHP

I've read a couple of posts here on the site and as far as I understand it, using PHP to get and process the information obtained through a Barcode Scanner is possible, however I'd like to ask just to make sure, is it recommended? are there any caveats I should be aware of?

EDIT I don't know the software of the barcode scanner since I haven't had access to it, however I described how it works on the comments down here. the barcode generates a fixed number of characters so I guess I could use a javascript event listener =)

Upvotes: 0

Views: 3863

Answers (1)

Bailey Parker
Bailey Parker

Reputation: 15905

I've noticed a lot of stores use online or LAN POS sites to handle purchases. Typically, the add an item page will set focus to a text field devoted to the product's barcode. When the scanner scans the barcode it's been preconfigured to output the code to wherever the cursor is (in this case, the barcode text field). Most system then have a JavaScript event listener on the field that submits the new item when a barcode is entered (the field reaches a certain length). Of course this is all theory. If you want sample code, please provide more specifics on the scanner and the software it came with.

Upvotes: 5

Related Questions