javascript - JS/PHP 'listener' to trigger an event -


i'm making application using php, , wanted build simple page sound played if 2 values in mysql row set '1' (true).

for instance, if none or 1 of values set 1, script not play sound.

however, second value changes 1, there should js 'listener' detects , automatically plays sound.

is there way achieve this?

it can done using websockets pushing message client side. here solution implementing websockets in php.

also here answer how create websockets server in php if want yourself. can tell using php websocket server not going scale if user base huge. may want consider doing using node.js.

another option: can check update using ajax time time. not instantaneous websocket solution. in solution server receive 1 req per user each x seconds.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -