Write CGI programs with Delphi (1)

zhaozj2021-02-17  52

Write CGI programs with Delphi (1)

1.0, the function of the CGI program: First, what is the public network access (CGI)? CGI is a standard for defining communication methods between web servers and external programs such that external programs can generate html, images, or other content, while the server processes HTML, images or other content generated by those non-external programs. The processing method is the same. Therefore, the CGI program does not allow you to be able to generate static content, and can generate a dynamic content. The original use of CGI is a standard for a definition and widely supported. Although Java, ActiveX, etc. can be completed in CGI program, but not all views are supported. Instead, all views are supported by CGI, such as: Lynx, IE, Netscape, etc. However, with other technologies, CGI also has its locality. I will tell the function, advantages and lack of CGI program. 1.1, CGI functions have a lot of tasks, CGI is the best choice, these tasks can be divided into three categories: initial tasks, medium-level tasks and high-level tasks. The primary task is some tasks that don't have to be programmed, such as text-type counters generating simple HTML programs less than 50 rows of PERL language, shell scripts, C language or C language written, such tasks, using CGI to write at least three points Benefits: First, CGI is the fastest, while Java is too large; second, CGI standard is most compatible with the current browser, this is already mentioned earlier; third, CGI resources are rich, you can find on the Internet Thousands of CGI code. The intermediate task is to include image images and other slightly complex programming tasks. In the medium-level task, the difficulty of compiling the program with CGI and Java is not large. Such a task includes image portraits, a html, a whole page, is very characteristic. For high-level tasks, use CGI to program more than Java programming. Such tasks are: Back-end Database Operations Searching in Multi-Dynamic Page, the rear-end data library operation (the application program of the database) is now the advantages of CGI. CGI has a historic history. There are many useful functions in the CGI library, which is made by others; at the same time, many companies provide the source code for CGI. Java is a programming language, and CGI is the function of the network level.

If Java has a large change, you have to rewrite the entire program; CGI has a large change, you only want to upgrade the CGI library program. However, CGI is still subjective in some aspects. 1.2, the local limit of CGI is in the image image and the moving, the CGI program is not as good as the Java program. The more the Java is increasing, the CGI program is increasing, the more appropriately compiled the program of simple and short and miscellaneous, and the data library application procedure. 1.3, the maximum character of the CGI program function CGI program can be made with any words, can be operated on any one platform, only it can be constructed with the specification of CGI. The following table is a comparison: Task CGI HTML HTML Processing Form Yes No Create a Web Page Nonstatic Content Yes No Processing Image Image Yes YES Search YES NO Creating Form Yes Yes Yes YES Create a Platform Unrelated document YES YES Create a chat room, etc. Interactive application YES NO page dynamically generated Yes No need to make a page document Cut Yes No, we use a series of "Hello World" programs to end this: Perl: Require "CGI-LIB.PL" Print & PrintHeader; Print "/ n"; Print "Hello World / N"; Print & Printenv; Exit; This file is stored in a C: / HTTPD / CGI-BIN directory, file name is 2_1.pl. Use the address http://localhost/cgi-bin/2_1.pl in the browser. Note, Omnihttpd should be running. If you do it, you can see "Hello World" and the environmental variables in the browser.

转载请注明原文地址:https://www.9cbs.com/read-30781.html

New Post(0)