Note: After completing the goaheaders, output the single content of the front table to the back end. Modify route.txt in the configuration file. Otherwise, an error is reported.
1. First find the goahead. c file under the goahead-4.0.2/src directory
Declare a static int test (webs * WP) before its Mian );
Add
Websdefineaction ("test", test );
Defined after the main part
Static int test (webs * WP)
{
Int I = 0;
Char * u, * P;
U = websgetvar (WP, "username ","");
P = websgetvar (WP, "PWD ","");
Printf ("username: % s \ npwd: % s \ n", U, P );
Webswrite (WP, "username: % s \ n", U );
Webswrite (WP, "PWD: % s \ n", P );
Webssetstatus (WP, 200 );
Webswriteheaders (WP, 0, 0 );
Webswriteendheaders (WP );
Websdone (WP );
Return 0;
}
Save and re-compile goahead
./Congfigure make sudo make install
2. Compile the front-end file. The file name here is formtest. asp.
Create a new web directory under goahead-3.6.5/bliud/linux-x86/bin to store it
<! Dostype HTML>
<HTML>
<Head>
<Title> formtest </title>
<Meta charset = "UTF-8">
</Head>
<Body>
<Form action =/goform/test method = "Post">
<Table> <tr> <TD> account: </TD> <input type = "text" name = "username"> </TD> </tr>
<Tr> <TD> password: </TD> <input type = "password" name = "PWD"> </TD> </tr>
<Tr> <TD> <input type = "Submit" value = "Submit"> </TD>
<TD> <input type = "reset" value = "reset"> </TD> </tr> </table>
</Form>
</Body>
</Html>
Then return to the bin directory and enter sudo goahead-V -- home/etc/goahead/home/tbs/goahead-4.0.2/bliud/linux-x86.../bin/Web 0.0.0.0: 8080
Enter http: // 0.0.0.0: 8080/formtest. asp in the browser
Goahead outputs the foreground form content to the background