beautypg.com

Solvline Eddy DK Ver 2.20 User Manual

Page 66

background image

Chapter 8. Handling HTML & CGI

8-4

else

{

listPutf(list, "

n_web_di

", "selected");

listPutf(list, "

n_web_en

", "");

}

The following shows processing part of setagent.c to save user-modified configuration value when the user clicks on

“submit” button on HTML page.

[Source abstract]

value2 = cgiFormStringNoNewlines("

N_IP

", buff, 16);

if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.ip);

value2 = cgiFormStringNoNewlines("

N_MASK

", buff, 16);

if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.mask);

value2 = cgiFormStringNoNewlines("

N_GW

", buff, 16);

if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.gateway);

value2 = cgiFormStringNoNewlines("

N_DNS

", buff, 16);

if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.dns);

cgiFormInteger("

N_TELNET

", &value, cfg.system.telnet_server);

cfg.system.telnet_server = value;

cgiFormInteger("

N_WEB

", &value, cfg.system.web_server);

cfg.system.web_server = value;