If you get a smart card or magnitized card or whatever, that sends the data as keyboard input (i.e. much like USB bar code scanners), then you can easily do what you want.
I.E.
Page loads and focuses to desired field
User uses card and data is automatically inputted into the focused field
On the fields change, you can use JS to submit the form to perform the query.
Perform the query with your desired language.
So, etully is mainly correct, PHP is not used. JS and whatever server side language you desire. I say etully is mainly correct because I can think of a few ways to use a smart card.