reference: [url]http://devedge-temp.mozilla.org/library/manuals/1998/htmlguide/tags17.html[/url]
[b]Invoking a CGI Program[/b]
You can use URLs to invoke CGI programs. A CGI program runs on a a server, processes arguments sent by the URL, and returns data to the browser. It is beyond the scope of this reference to provide details of CGI programming, but many fine books are available on the subject, and also lots of information is available on the web.
To specify a URL that invokes a CGI program, specify the location of the CGI program, followed by a query string which contains the arguments for the program. A query string consists of a question mark, followed by the name/value pairs to be submitted to the program. Each name/value pair is separated by an &. Use the URL-encoded value %20 to indicate white spaces and %0A to indicate new lines.
The following example invokes the program "compute.cgi" that takes three arguments. The value of the argument val1 is 25, val2 is 39, and text is "how now brown cow".
http://www.somecompany.com/cgi-bin/compute.cgi?val1=25&val2=39&text=how%20now%20brown%20%cow
Note that in the above example there should be no line breaks; the line break shown is for readability only.
[b]More good references about invoking CGI:[/b]
[url]http://www.cs.cf.ac.uk/Dave/PERL/node193.html[/url]
[b]Invoking a CGI Program[/b]
You can use URLs to invoke CGI programs. A CGI program runs on a a server, processes arguments sent by the URL, and returns data to the browser. It is beyond the scope of this reference to provide details of CGI programming, but many fine books are available on the subject, and also lots of information is available on the web.
To specify a URL that invokes a CGI program, specify the location of the CGI program, followed by a query string which contains the arguments for the program. A query string consists of a question mark, followed by the name/value pairs to be submitted to the program. Each name/value pair is separated by an &. Use the URL-encoded value %20 to indicate white spaces and %0A to indicate new lines.
The following example invokes the program "compute.cgi" that takes three arguments. The value of the argument val1 is 25, val2 is 39, and text is "how now brown cow".
http://www.somecompany.com/cgi-bin/compute.cgi?val1=25&val2=39&text=how%20now%20brown%20%cow
Note that in the above example there should be no line breaks; the line break shown is for readability only.
[b]More good references about invoking CGI:[/b]
[url]http://www.cs.cf.ac.uk/Dave/PERL/node193.html[/url]
本文介绍如何使用URL来调用CGI程序,并详细解释了查询字符串中参数的编码方式。此外还提供了几个关于CGI编程的参考资料。
2215

被折叠的 条评论
为什么被折叠?



