For those interested, I got it to work with this SORT OF.. I used Xcode to write this (it's not fun to test on the arduino).
I wish arduino uses objective C
char mystring[] = "GET /http://arduino/?page=1&time=20,40,30,2,14,2013¶m2=54 HTTP/1.1";
char temp1[40];
char temp2[40];
char *a = strstr(mystring, "time");
strncpy(temp1, a, sizeof(temp1));
char *b = strstr(temp1, "&");
strncpy(temp2, a, b-temp1);
printf("%s : %s ", temp1, temp2 );
output
time=20,40,30,2,14,2013¶m2=54 HTTP/1
: time=20,40,30,2,14,2013
but if I change the keyword search to 'page', I get some pointer junk at the end of the string.
output
page=1&time=20,40,30,2,14,2013¶m2=54
: page=1\231\333h
Any ideas? Somehow convert the 'b' pointer to an integer?