Reputation: 1
I'm still new in programming and my situation is: I want to do a webpage connect to MySQL by using php How I read the data from card reader in this way? By using php also? And how I format or read the data from the card? And then it is necessary for me to get card reader which has SDK so that I can read the data from the card?
Upvotes: 0
Views: 8640
Reputation: 182
You must use this library
PC/SC for PHP5
And install the php extension for PC/SC https://pecl.php.net/package/pcsc
But you need to install an older version of Laravel to use PHP5, the library is not compatible with PHP 7
Upvotes: -1
Reputation: 40849
A PHP web application's code is typically executed on the server side, so if you want to interact with a smartcard reader on the client side, you will need to use something else besides PHP code to access that client-side hardware. There are different possibilities on how to perform such access:
You could develop/use a Java applet embedded into the web page -- this is what most web applications do at the moment. If the smartcard reader is PC/SC-compliant, you could use the Java SmartcardIO API within that applet to access the reader and forware information to your PHP application on the server.
Another option could be a client-side application (you would need to create and provide that application) that acts as a web server itself and processes JSON (or whatever) GET/POST requests. That client-side application would then access the smartcard reader and your web application's (Java) script code could send JSON (or whatever) requests to it to retrieve card data.
Instead of a client-side stand-alone application you could also create a web-browser plugin (again, you would need to create and provide that plugin). That plugin could then act as a proxy between your web-application and the smartcard reader.
Upvotes: 0