使用简单的php形式在NFC标签上编写 [英] Write on a NFC tag using simple php form

查看:384
本文介绍了使用简单的php形式在NFC标签上编写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用NFC,我必须编写一个简单的php表单,其中包含一些数据(id,name,qty等),并将这些值存储在NFC标记上(我将使用GET或POST方法) .

如何将这些数据存储在NFC标签上?我有一个GoToTags设备可将信息存储在NFC标签中,但是我认为我不能使用它来存储我的自定义"值.

I'm using NFC for the first time, I have to write a simple php form with some data (id, name, qty, etc) and store these values on an NFC tag (I would use GET or POST methods).

How can I store these data on an NFC tag? I have a GoToTags device to store information in a NFC tags, but I don't think I can use it to store my "custom" values.

推荐答案

PHP Web应用程序的代码在服务器端执行,因此,如果要与客户端上的硬件(NFC阅读器,NFC标签)进行交互,则需要将需要使用除PHP代码以外的其他方式来访问该客户端硬件.

A PHP web application's code is executed on the server side, so if you want to interact with hardware (NFC reader, NFC tag) on the client side, you will need to use something else besides PHP code to access that client side hardware.

客户端NFC阅读器通常不会充当Web服务器,因此无法通过HTTP GET/POST请求进行访问(请参见下面的异常),因此您将不得不寻找其他东西.

The client-side NFC reader would typically not act as a web server and therefore won't be accessible through HTTP GET/POST requests (see the exception below), so you will have to find something else.

您的Web应用程序还将包含一个在客户端显示和执行的网页(HTML,CSS,(Java)脚本).例如,此网页可以包含在客户端网络浏览器中执行的脚本代码.

Your web application will also consist of a web page (HTML, CSS, (Java) script) that is displayed and executed on the client side. This web page could, for instance, contain script code that is executed within the client web browser.

  • 正如GeraldSchneider所说,有NFC Web API,但这在大多数(任何?)网络浏览器中尚不可用.

  • As GeraldSchneider commented, there is the NFC Web API, but this is not yet available in most (any?) web browsers.

另一种选择是嵌入到网页中的Java applet.例如,如果NFC读取器兼容PC/SC,则可以使用该小程序中的Java smartcardio API来访问读取器.

An alternative could be a Java applet embedded into the web page. If the NFC reader is PC/SC compliant, you could, for instance, use the Java smartcardio API within that applet to access the reader.

另一种可能性是创建一个浏览器插件,该插件支持您的网页和NFC设备之间的通信.

Yet another possibility would be to create a browser plug-in that supports communication between your web page and the NFC device.

如果您确实希望/需要使用HTTP GET/POST请求,则可以提供一个充当Web服务器并处理GET/POST请求的客户端应用程序.然后,该客户端应用程序将根据这些请求访问NFC阅读器/NFC标签.但是,除了PHP Web应用程序/网页之外,您还需要提供单独的客户端应用程序,并且该应用程序需要在访问网页时在客户端上运行.

If you really want/need to use HTTP GET/POST requests, you could provide a client-side application that acts as a web server and processes your GET/POST requests. That client-side application would then access the NFC reader/NFC tag based on these requests. However, besides the PHP web application/the web page you would also need to provide that separate client application and the application needs to run on the client while your web page is accessed.

这篇关于使用简单的php形式在NFC标签上编写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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