When we use GET method we use ambersand(&
) sign to send the data to a particular script. I'm sending data to a php script called myscript.php
by the GET method from a javascript like the following :
http.open('GET', 'Myscript.php'+ '?d=' + value1 + '&c=' + value2 + '&f=' + value3);
But if the value1 or value2 or value3 contains an &
sign in their actual value (for example if somebody enter for the value1 garth&ggg&kkk
then the Myscript.php
can't handle the value1 properly because it contains an &
sign in the actual data. It takes the value garth
for value1.
My php code is as follows:
if (isset($_GET['d'])) { $a = $_GET['d'];}