Description |
The cgi_process_var function
processes the environmental variable QUERY_STRING that is returned
from the CGI form GET method. The HTTP server calls this function
when a user presses the SUBMIT button on the input form, using a web
browser.
The argument qs points to the QUERY_STRING that is returned
from the GET method.
The cgi_process_var function is in the HTTP_CGI.c module.
The prototype is defined in net_config.h.
note
|
Example |
void cgi_process_var (U8 *qs) {
U8 var[40];
do {
/* Loop through all the parameters. */
qs = http_get_var (qs, var, 40);
/* Check the returned string, 'qs' now points to the next. */
if (var[0] != 0) {
/* Returned string is non 0-length. */
if (str_scomp (var, "ip=") == __TRUE) {
/* My IP address parameter. */
sscanf (&var[3], "%bd.%bd.%bd.%bd",&LocM.IpAdr[0],&LocM.IpAdr[1],
&LocM.IpAdr[2],&LocM.IpAdr[3]);
}
else if (str_Scomp (var, "msk=") == __TRUE) {
/* Net mask parameter. */
sscanf (&var[4], "%bd.%bd.%bd.%bd",&LocM.NetMask[0],&LocM.NetMask[1],
&LocM.NetMask[2],&LocM.NetMask[3]);
}
else if (str_scomp (var, "gw=") == __TRUE) {
..
}
}
}while (qs);
}
|