Reputation: 153
I want to develop a web application to read data from a MIFARE chip card. The idea is for a program of fidelization for a shop.
Is possible to read the data from within a browser? How could this possibly work?
Upvotes: 1
Views: 2154
Reputation: 40831
A PHP web application's code is executed on the server side, so if you want to interact with a MIFARE card (through a contactless smartcard reader) on the client side, you will need to use something else besides PHP code to access that client side hardware.
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.
There is the upcoming NFC Web API to access client-side NFC hardware (that could possibly be used as MIFARE card reader), but this API is not yet available in most (any?) web browsers and it would only allow access to NDEF data on NFC tags. So you would need to use the MIFARE card as NDEF tag.
An alternative could be a Java applet embedded into the web page -- this is what most web applications do at the moment. If the MIFARE card reader is PC/SC compliant, you could use the Java SmartcardIO API within that applet to access the reader.
Another option could be a client-side application (you would need to create and provide that application) that acts as a web server and processes JSON (or whatever) GET/POST requests. That client-side application would then access the MIFARE card reader and your web application's (Java) script code could send JSON (or whatever) requests to it to retrieve card data.
Upvotes: 2