At least I assume that it my problem here^ Basically, its really simple, im sending an ajax made get string to a php script, however the string is not being broken down correctly apparently.
Ajax snippet:
xmlhttp.open("GET","ajaxQuery.php?name="+str+"&identifier="+id,true);
xmlhttp.send();
PHP
//variables sent from Ajax
$owner = $_GET['name'];
$identifier = $_GET['identifier'];
For some reason $_GET['identifier'] is empty. a print_r($_GET) shows me:
Array
(
[name] => John Doeidentifier=1
)
The name is John Doe and the id is 1, but for some reason they are not splitting up, and as far as i am aware, my Get string is compiled correctly any ideas?
Its likely the url is broken due to the space in one of the strings. To fix this, what you need to do is encode each variable so that spaces and other special characters get handled correctly
xmlhttp.open("GET","ajaxQuery.php?name="+encodeURIComponent(str)+"&identifier="+encodeURIComponent(id),true);