Url encode decode anchor links with AngularJS PHP

I had following link  in one of rest call which lead to SQL unexpected result due to & symbol.

http://localhost/test/getDsv?$top=32&$skip=0&var=HR & Admin&com=


Query has only considered var=HR  only  which leads to unexpected results.

My front end is anguler and I can encode the perticulter paramenter with window.encodeURIComponent()

Ref : http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax


To Decode it at PHP side there in nothing to do ,although there are lot of posts ,which indicate decoding.

$this->_request['var'];

http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax


Comments

Popular posts from this blog

ENOENT: no such file or directory, rename : node_modules/async

react-quill Integrate quill-image-resize-module