1. Transplantation of cgic Library
Cgic is a standard C library that supports CGI development. It can be used for free. You only need to make a public declaration in the developed site and program documentation, indicating that the program uses the cgic library, users can also purchase commercial licenses without making a public statement.
Cgic provides the following functions:
1. analyze data and automatically correct data sent from defective browsers;
2. transparently receive from data sent using the get or POST method;
3. files can be uploaded;
4. Set and receive cookies;
5. process the carriage return in the from element in a consistent way;
6. Provides the string, integer, floating point, single-choice or multiple-choice function to receive data;
7. Provides border check for numeric fields;
8. It can convert CGI Environment Variables into non-null strings in C;
9. Provides CGI program debugging means to play back the CGI status during CGI program execution;
Cgic is a powerful Standard C library that supports CGI development and supports multiple operating systems such as Linux, UNIX, and windows.
The following describes the migration process:
1. Download the source code package from the main cgic site http://www.boutell.com/cgic/:cgic205.tar.gz. the latest version is 2.05;
2. Decompress cgic205.tar.gz and enter the source code directory;
Tar xzvf cgic205.tar.gz
CD cgic205
3. Compile cgic
Make
The obtained cgic library libcgic. A file
NOTE: If it is transplanted to the embedded platform, the parameters such as the compilation command and AR in the MAKEFILE file need to be changed accordingly, such as CC = GCC, change to CC = Cc = arm-hismall-Linux-GCC.
4. Put the compiled capture file and cgictest. cgi file in the cgi-bin directory of the Web server;
5. Enter the following address in the browser address bar of the client:
Http: // 192.168.78.128: 8080/cgi-bin/cgictest. cgi
The page is displayed, indicating that the cgic library and test script are successfully transplanted!
Note: You need to change the cgi-bin directory under the Web Server Directory to readable, writable, and executable (chmod-r 777). Otherwise, the page cannot be accessed.