javascript ajax post words which contains & symbol and decode in php -


i m trying send ajax post contains '&'.

search.php?region=middle%20east%20&%20africa&city=&language= 

but return 'middle east' in php side

please me

if using jquery:

$.ajax({     url: 'search.php',     type: 'post',     data: { region: 'middle east & africa', city: '', language: '' },     success: function(result) {         // ...             }  }); 

if not manually url encode value using encodeuricomponent function:

var region = encodeuricomponent('middle east & africa'); // todo: send encoded value 

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -