-2

We're developing a web application for a hospital using PHP. We want to be able to give our patients cards to swipe at the OPD which will then display information about them.

Our programmer only codes in PHP and JavaScript so we need to know if it is possible and which device will be best suited with a PHP API.

halfer
  • 19,824
  • 17
  • 99
  • 186
sirhcg
  • 1
  • 1
  • This isn't a duplicate in my opinion. It's a pretty specific question towards a way to build something. Not only read a card. It should be unmarked as duplicate – Benjamin de Bos Dec 17 '14 at 12:45
  • @Benjamin: it could equally be closed as too broad. The OP would be best finding what devices are available in their area of the world (since this varies a great deal) and they will need to do some research on the future availability of these devices, to determine if replacements can be had years down the line. They can then look at the interfacing requirements for a set of shortlisted devices and see how to best interface them with PHP. Short answer is: more research required from the OP. – halfer Dec 17 '14 at 12:47
  • I expect these devices would often be USB now, since that is so ubiquitous, and that many of them would come with Linux drivers that can be read by `cat` in the `/proc` folder. Or the dup link suggests some of them might emulate keyboards, and so a PHP process could be used to read that into `stdin`. – halfer Dec 17 '14 at 12:49
  • @halfer I could agree with too broad. It's just that lately questions are marked too fast as duplicate. In my opinion this could also figure as an example where someone picks the wrong technique for the problem given. – Benjamin de Bos Dec 17 '14 at 12:52
  • @Benjamin: you can always raise that on _Meta_ if you think it is a real problem. However I wouldn't worry about it - one of the ways in which I think I best help these days is not in providing technical solutions, but in encouraging OPs to do meaningful prior research, and teaching OPs how to ask questions. That applies here, IMO. – halfer Dec 17 '14 at 12:56

1 Answers1

0

This is probably the worst solution for the problem. However; you could bridge a PHP CLI program with a websocket html page which runs in kiosk mode.

For reading the comport: http://blog.950buy.com/article/php-use-rs232-serial-communication-to-send-file/

For more information about websocket and a client/server websocket implementation: http://www.sanwebe.com/2013/05/chat-using-websocket-php-socket

  1. PHP Forloop reading the comport.
  2. If information is found; push to websocket
  3. Webpage listens to websocket and get the information in json
  4. Webpage decodes the json and display's information

Again; i feel a bit uncomfortable that you're trying to sell this to someone probably without telling that you are going "to transfer a valuable load using fireworks". This methaphore doesn't make sense, like your choice of language.

Benjamin de Bos
  • 4,334
  • 4
  • 20
  • 30
  • Tnx everyone I know php may not be the best choice for this but we're a young company and have a single programmer who happens to use only php and javascript I'm going to check out the links i've been given to see what i can find thanks – sirhcg Dec 21 '14 at 14:54