JS to PHP RPC communication