Вернутся на главную

Technology CGI, the response headers and requests for CGI.


Technology CGI, the response headers and requests for CGI. на нашем сайте

Статьи
Статьи для студентов
Статьи для учеников
Научные статьи
Образовательные статьи Статьи для учителей
Домашние задания
Домашние задания для школьников
Домашние задания с решениями Задания с решениями
Задания для студентов
Методички
Методические пособия
Методички для студентов
Методички для преподавателей
Новые учебные работы
Учебные работы
Доклады
Студенческие доклады
Научные доклады
Школьные доклады
Рефераты
Рефератывные работы
Школьные рефераты
Доклады учителей
Учебные документы
Разные образовательные материалы Разные научные материалы
Разные познавательные материалы
Шпаргалки
Шпаргалки для студентов
Шпаргалки для учеников
Другое

CGI is the connection (or interface) between a form on a Web page and the Web server. It is the interface between the Web page or browser and the Web server that runs the program. CGI programs are requested like any other regular documents. The difference is that instead of returning a static document, the server executes a program and returns its output.

read string

echo Content-type: text/html

echo ""

echo query string: $string

echo "

"

echo $string | awk -F= '{print "Hello", $2, "!"}' | sed 's/+/ /'

Headers can describe: The size of the data; Another document that the server should return (that is, instead of returning a virtual document created by the script itself); HTTP status codes

Content-length:The length of the output stream. Implies binary data.

Content-type: The MIME content type of the output stream

Expires: Date and time when the document is no longer valid and should be reloaded by the browser

Location: Server redirection (can`t be sent as part of a complete header).

Pragma: Turns document caching on and off

Status: Status of the request (can`t be sent as part of a complete header).

Header lines don't have to be in any special order.They can be output in any order you like. The header block has to end with a blank line.

The way the server knows that you're done with your header information is that it looks for a blank line. Everything before the blank line is taken as header information; everything after the blank line is assumed to be data.

The request method is specified in the environment variable REQUEST_METHOD.

GET: the query string sent is placed in the environment variable QUERY_STRING for CGI script to process.

POST: the query string is sent by a separate stream and becomes the standard input to the CGI script. Note: when POST is used, the environment variables are set: CONTENT_LENGTH, CONTENT_TYPE.





Название статьи Technology CGI, the response headers and requests for CGI.