Hi I’m new to xmlhttprequest and am not sure if this should go in the javascript section or php section.
I’ve got my xmlhttprequest working with POST as the method.
xmlhttp.send(queryString);
and my string looks like this
indentifyer1=object1&indentifyer2=object2&indentifyer3=object3& so on..
I can then access my string in PHP like this:
[code=php]$var1 = $_POST[‘identifyer1’];
$var2 = $_POST[‘identifyer2’];
$var3 = $_POST[‘identifyer3’];
//and so on…
echo $var1;
// which gives me – object1
Problem is If the string is put together based on user input then I don’t have any way of knowing how long the string is and how many objects are in it and how many $vars to set up.
Normally I would set up a for loop in php based on the length of an array etc but can’t do that here. Is there anyway to better identify the length of the string in PHP or is there a better way to format the queryString in Javascript?
thanks fo any help.
Chris?