Dear all,
I’ve question related to PHP/MySQL and barcodes. I’m trying to build simple web based loyalty system for the restaurant as my university project.

I’ve got customers database on a server. In order to identify each customer, they would have loyalty card with barcode assigned to their online account. Is it possible to search the individual customer in the database using PHP form and barcode scanner?

For example I'm trying to edit customer's details. In theory it would look like that:
1. I'm connecting to the database through website
2. Available actions: I - edit customer, II - add points, III - delete customer, etc
3. I pick option: I
4. Website asks to enter customer’s ID
5. Barcode scanner reads the barcode of the card provided
6. Web page with customer’s account appear on the screen and I'm able to edit their details

I’ve got working website with the database but I would like to add barcode reader as an extra feature. Could someone tell me is it achievable to connect these two or is it pointless.

Thanks a lot for your help.

    Pointless? I doubt it. Possible? Likely, but I'm not sure HOW without some research. As point #5 suggests input to a browser, at the very least some Javascript would be involved --- not to mention the device itself, which probably has a driver written in something else entirely.

      dalecosp wrote:

      which probably has a driver written in something else entirely.

      If I recall (I haven't bothered to search the forums, but I think the question has come up before - at least somewhere - the scanner is likely to have a driver that makes it look just like a keyboard. Scanning a barcode that reads [font=monospace]EFEF0070108552[/font] would have exactly the same effect as someone typing [font=monospace]EFEF0070108552[/font]. Probably followed by a carriage return/linefeed. Need to consult the scanner's documentation for that.

        Weedpacket;11024233 wrote:

        If I recall (I haven't bothered to search the forums, but I think the question has come up before - at least somewhere - the scanner is likely to have a driver that makes it look just like a keyboard. Scanning a barcode that reads [font=monospace]EFEF0070108552[/font] would have exactly the same effect as someone typing [font=monospace]EFEF0070108552[/font]. Probably followed by a carriage return/linefeed. Need to consult the scanner's documentation for that.

        Assuming, then, that all users are benevolent (heh, heh), some JS that ran every second or two on the page and checked the length of the input field might be configured to send some AJAX to the server, and then voila` and all that, I suppose ;-)

          There are scanners that attach to a PC, inline with the keyboard. I've seen some with a dual-sex, barrel connector on the end. Plug it into the PS2 port, and the keyboard into the back. I'm sure there are USB equivalents now.

          Scanning a barcode has the same effect as typing in the relevant numbers on the keyboard.

          You have to have focus on the right field of your page of course, which you can do with a little jQuery.

            Absolutely. I wrote a similar application for the college where I work.

            All a barcode scanner is, is a keyboard that reads bar codes -- it even includes a carriage return in the sequence. Grab a USB Barcode Scanner (I can recommend the Wasp WPS150 Omnidirectional) and plug it in. Use some javascript to give the focus to the text field when you hit the page; scan the ID and it will auto-submit because of the carriage return. On the next page process the results and handle the data.

              a month later
              5 months later
              Wynder;11024305 wrote:

              Absolutely. I wrote a similar application for the college where I work.

              All a barcode scanner is, is a keyboard that reads bar codes -- it even includes a carriage return in the sequence. Grab a USB Barcode Scanner (I can recommend the Wasp WPS150 Omnidirectional) and plug it in. Use some javascript to give the focus to the text field when you hit the page; scan the ID and it will auto-submit because of the carriage return. On the next page process the results and handle the data.

              yes, and as for reading barcode ,you may refer to barcode scanner hardware and barcode reader software. Hope you can find what you want!

                Write a Reply...