Passing VUE Websockets variables

Asked

Viewed 53 times

0

When I pass a variable this way in Vue, how do I recover it in PHP file?

self.ws = new WebSocket('ws://localhost:9000?variavel=22');

$_GET ?

  • https://stackoverflow.com/questions/39191583/how-to-get-url-param-with-php-websocket#comment65723838_39191583

  • Thanks for the answer, I am trying to apply it without success, I am doing it this way: front: self.Ws = new Websocket('Ws://localhost:9000?mat_func=22'); back: // Starting connection $server = Ioserver::Factory( new Httpserver( new Wsserver( new Simplechat( @$_SERVER['QUERY_STRING']) ) ), 9000 ); $server->run(); would be something like that?

  • Avoid the use of @ in the code and if possible use the xDebug or var_dump() to check if the variables are receiving the value.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.