[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Parsing af param=value strenge med libc



Hej,
hvordan parser jeg lettest POST data og HTTP_COOKIE strenge i c ved hjælp af libc eller lign.?


En HTTP_COOKIE streng ser således ud:
uid=234; qid=124; zid=1
bemærk ';' samt ' ' (space) som delimiter
jeg parser HTTP_COOKIE strengen med strstr til at finde "param=value", og strchr til at splitte param fra value.
Koden virker fint men den er på ca. 30 linier og er rimelig kompliceret. (=muligvis fejlbehæftet)


En POST data streng ser således ud:
username=henrik&password=2&qid=124&zid=1
Det kunne jeg jo lave på samme måde, men sådan en hjemmelavet funktion er jo ikke lige sagen, bla. på grund af det faktum at cgi programmer lever et udsat liv.


Men jeg er jo nok ikke den første i verden som skal lave et cgi program som skal parse disse strenge.
Jeg har googlet lidt men uden held...
Hvad gør i?



-- med venlig hilsen

Henrik Bork Steffensen




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *