avr tcp
yashmodi, i was trying to answer that in details but subject requires more than 6 hours to give a detailed conclusion. In brief you should:
a. write function to set and read port outputs . Better to put it into cgi.c. You should add it to cgi function pointer table so it will be called from cgi script under name 'd'
b. write html containing html form and put it into fsdata.c source code .
c. update , let say index.html with link to this newly created form page (step b)
d. write script page to handle browser request , when invoked from form page (created in step b). It should also be put into fsdata.c soruce file
that script should contain reference to newly created cgi.c functions.
e. cgi.c function created in step 'a' will be invoked while running script created on step d. It should parse uip_appdata[] buffer to extract post GET request parameters and replay back with result (part of html page as a result)
Set the action option for form tag in html to cgi script filie name (for file created in step b)
<form name=xxx method=GET action=/cgi/your script name >
That is very brief and is not complete
Yet , remeber that file data in fsdata contains file name starting from first character in file data buffer till first null value character (serving as terminator), then rest is the file content .
Or , you can intercept the GET in httpd.c file and ignore script handling at all .