CGI Program (Common Gate-Interface)
A program that is called by the server outside the server to allow the server to perform more powerful functions after the CGI program is mated to the server.
1. The browser requests a URL to a CGI application through an HTML form or hyperlink.
2. The server receives the request.
3. The server executes the specified CGI application.
4.CGI applications perform the actions required, usually based on what the browser has entered.
5.CGI applications format the results as Web servers and browsers can understand documents (usually HTML pages).
6. The Web server returns the results to the browser.
Porting a CGI library
1. Unzip
Tar zxvf cgic205.tar.gz
2. Modify Makefile
CD cgic205
Vim Makefile
Modify tool chain to arm-linux-
3. Compiling
Make
5. Copy Library files
CP libcgic.a .../rootfs/lib
6. Modify the BOA configuration file
scriptalias/app//web/app/specifying the CGI program path
7. Modify the Web page
<a class= "Menu" href= "/led.html" >led control </a>
The tag invokes the CGI program through action, and the parameter is passed to the CGI program via the URL address.
Writing CGI Programs
Compiling CGI programs
Arm-linux-gcc–l./cgic205–lcgic-i./cgic205 Led.c–o led.cgi
-L represents the library file path,-l represents the library file to include,-I represents the header file path
[Country EMBED strategy] [174] [CGI QuickStart-Web control LED]