是否可以使用PHP& MySQL的? [英] Is it possible to read/access the bar-code scanner values using PHP & MySQL?

查看:110
本文介绍了是否可以使用PHP& MySQL的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使PHP网站能够识别条形码输入.

I am trying to enable a PHP website to recognize barcode input.

我将在浏览器中加载网页,将焦点(光标)设置为接收到文本框中的输入.

I will load a web page in a browser, the focus (cursor) is set to recieve input into the text box.

我将把条形码阅读器/扫描仪插入PC,并使用扫描仪一一扫描条形码.条形码中的信息可以放入网页的文本框中吗?

I will be having a barcode reader/scanner plugged into the PC and will scan the barcodes one-by-one using the scanner. Would the information from the barcode can be put into the text box of the web page ?

重要的问题是,如何使用PHP读取扫描仪的输出?

The important question is that how can I read the output from the scanner using PHP ?

请告知.

推荐答案

遇到类似的问题.条形码扫描仪的工作方式类似于键盘,只需输入一个字符串即可.通常可以对扫描仪进行配置,以使它们通常在每个条形码类型的基础上,对从条形码读取的字符添加前缀或后缀(例如,对于Code 39,其配置与对于Code 128,可以具有不同的配置)

Had a similar problem. Barcode scanners work like keyboards, they just enter a string. The scanners can usually be configured so that they add a prefix or a postfix to the characters read from the barcode, often on a per barcode-type basis (can have different config for Code 39 than for Code 128 e.g.)

但是,我们在上一个项目中遇到的一个问题是,开发出纳系统的人员还配置了条形码扫描仪,并且他们将CTRL-B作为每个条形码的前缀.在Firefox中,这会打开书签,因此您被困住了.

But, a problem that we had in our last project was, that the guys that developed the cashier system also configured the barcode scanner and they put a CTRL-B as a prefix in front of every barcode. In Firefox, this opens up the Bookmarks and so you´re trapped.

我的意思是,连接扫描仪很容易,但是如果某些控制字符可能被浏览器或某些其他软件捕获,则必须注意扫描仪的配置.另一方面,这可能非常有用,因为您可以在每个条形码或其他有助于分隔条形码的内容之后输入换行符.

What I mean is, connecting the scanner is easy, but you have to care for the configuration of the scanner if there are control character that might be captured by the browser or some other software. On the other hand, this can be very useful cause you can enter a linefeed after each barcode or something else that helps you separate them.

在我们的案例中,另一个重要方面是时机.条形码扫描仪输入字符的速度非常快,但是-至少是我们输入的字符-是一一输入的.因此,当我们测试功能时,从剪贴板粘贴的字符串与从条形码扫描的字符串之间存在巨大差异.这与我们所做的Ajax-Calls有关(在我们的情况下,基于ZK的网站对此有很多麻烦).

Another important aspect in our case was the timing. The barcode scanners enter the character quite fast, but - at least the one we had - entered it one by one. So when we tested our functionality, there was a huge difference between the string pasted from the clipboard or the string scanned from the barcode. This was relevant for Ajax-Calls we did (where in our case, a ZK-based website had lots of trouble with that).

希望有帮助.

这篇关于是否可以使用PHP& MySQL的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆