I'm trying to send a string, for example, "the cat & the dog" to php from angular via GET. I have done encodeURI(note)
and in php
$note = $_GET['note'];
$note = mysql_real_escape_string($note);
but when it inserts into the database is only puts any chars before the '&'
Use
encodeURIComponent(note)
Use encodeURIComponent
when you want to encode a URL parameter
https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
instead of
encodeURI(note)
Use encodeURI
when you want a working URL
https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/encodeURI