cgi(5)

πŸ“¦ version 0.6, in ubuntu jammy

πŸ’– cgi β€” Common Gateway Interface πŸ’–

okay bestie, so this is cgi(5) from the Programmer's Manual, and it's literally the blueprint for making web pages that do stuff instead of just sitting there. grab a snack, we're going in πŸ“


✨ NAME ✨

cgi β€” Common Gateway Interface


🌸 DESCRIPTION 🌸

The Common Gateway Interface is a way to create dynamic web pages. no cap, that's the whole glow-up: instead of a static lil file, the page gets built on the fly.

It defines the rules for how a program and the web server talk to each other while the server is talking to the client. it's giving very much a three-way group chat where everyone has their role πŸ’…

And there are some ways to use it. (yes that's it, that's the sentence, we move.)


πŸ¦‹ ENVIRONMENT πŸ¦‹

Normally the webserver sets several environment variables to hand some info over to the CGI program, so the program can figure out various stuff about who's asking and what they want. it's basically the server sliding the CGI program a note under the door 🫢

  • AUTH_TYPE β€” this reflects the authentification method used to validate a user.
  • CONTENT_LENGTH β€” the length of the data in bytes passed to the CGI program through standard input. this one is used by the POST method.
  • CONTENT_TYPE β€” the MIME type of the query data, such as "text/html", optional.
  • DOCUMENT_ROOT β€” this reflects the document root directory of the webserver.
  • GATEWAY_INTERFACE β€” reflects the version of the Common Gateway Interface that the server is using
  • HTTP_ACCEPT β€” a comma separated list of MIME type that the client is willing to accept.
  • HTTP_FROM β€” the email address of the user issuing the information request. > heads up: this is not supported by most browsers, so don't build your whole personality around it 😭
  • HTTP_REFERER β€” reflects the URL from which this CGI program was accessed.
  • HTTP_USER_AGENT β€” the name, version and libraries of the browser making the request. you can use this info to work out whether the browser is capable of graphics and is able to display frames and tables. (frames and tables… iconic era, honestly πŸ‘‘)
  • PATH_INFO β€” this shows extra information that was passed to the CGI program via command line. normally it's empty or non-existent.
  • PATH_TRANSLATED β€” the translated path on the local filesystem.
  • QUERY_STRING β€” this variable refers to additional arguments that were appended to the CGI program β€” normally with the '?' sign.
  • REMOTE_ADDR β€” this refers to the host from which the information request was issued, as IP number.
  • REMOTE_HOST β€” this refers to the host from which the information request was issued.
  • REMOTE_USER β€” the authenticated name of the user.
  • REQUEST_METHOD β€” this refers to the method with which the information request was issued. normally this is either GET or POST.
  • SCRIPT_NAME β€” the virtual name of the script being executed.
  • SERVER_NAME β€” the server's hostname or IP number. this may be used to determine the correct paths or resulting HTML code for CGI programs that are used on the same machine for several servers.
  • SERVER_PROTOCOL β€” this is the name and version of the information protocol the request came in with. normally this is "HTTP/1.0" or "HTTP/1.1".
  • SERVER_PORT β€” this refers to the TCP/IP port on which the webserver is running.
  • SERVER_SOFTWARE β€” this reflects the name and revision of the webserver software.

πŸŽ€ AUTHOR πŸŽ€

This CGI library is written by Martin Schulze <joey@infodrom.org>. if you have additions or improvements, please get in touch with him β€” he fr wants to hear from you πŸ’œ


🌈 SEE ALSO 🌈


and that's the whole vibe check, bestie 🧚 this page came to you from the CGI Library, dated 6 April 2008 β€” yes it's an elder, but it still ate πŸ’…βœ¨

πŸ“¦ where this page comes from
  • ubuntu jammy: cgilib 0.6-1.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms