linux_cgi编程(Linux_cgi programming)
linux_cgi编程(Linux_cgi programming)
This article is contributed by whyang2006
Pdf documents may experience poor browsing on the WAP side. It is recommended that you first select TXT, or download the source file to the local view.
Why CGI? In HTML, when customers fill out the form, and click the send button (submit), the contents of the form is sent to the server, in general, then you need to have a server-side script to form the content of some processing, or save them up. Or make some inquiries according to the content, or some other what. Without CGI, the world of WEB completely loses its interactivity, and all the information becomes one-way, without any feedback.
Some people think that JavaScript can be used instead of CGI programs, which is actually a conceptual mistake. JavaScript can only run in the client browser, while CGI is working on the server. The work they do has some intersection, such as form data validation, but JavaScript is absolutely impossible to replace CGI. But it can be said that if a job is to do with JavaScript, and can be used to do CGI, you absolutely need to use JavaScript, the speed of execution, JavaScript CGI has inherent advantages. Only those problems that can not be solved by clients, such as interacting with a remote database, should be used with CGI.
In brief, it is the interface CGI (Interface) that is used to communicate HTML forms and server-side programs. Say it is an interface, that is to say, CGI is not a language, but a set of specifications that can be applied by other languages. In theory, you can write CGI programs in any programming language, as long as you are programmed to conform to some of the things defined by the CGI specification. Because the C language in the platform independent of good performance (there are corresponding compiler in almost any platform, and are regarded as below) for the majority of programmers are familiar with (unlike Perl), therefore, C is one of the preferred language for CGI programming