Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
CGI /
Delete
Unzip
Name
Size
Permission
Date
Action
Cookie
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HtmlExtension
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
InvalidEncoding
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
QueryExtension
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Session
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
accept_charset%3d-c.ri
269
B
-rw-r--r--
2023-07-26 17:26
accept_charset-c.ri
256
B
-rw-r--r--
2023-07-26 17:26
accept_charset-i.ri
241
B
-rw-r--r--
2023-07-26 17:26
cdesc-CGI.ri
11.85
KB
-rw-r--r--
2023-07-26 17:26
env_table-i.ri
204
B
-rw-r--r--
2023-07-26 17:26
escape-c.ri
339
B
-rw-r--r--
2023-07-26 17:26
escapeElement-c.ri
942
B
-rw-r--r--
2023-07-26 17:26
escapeHTML-c.ri
377
B
-rw-r--r--
2023-07-26 17:26
escape_element-c.ri
236
B
-rw-r--r--
2023-07-26 17:26
escape_html-c.ri
227
B
-rw-r--r--
2023-07-26 17:26
header-i.ri
4.26
KB
-rw-r--r--
2023-07-26 17:26
new-c.ri
2.5
KB
-rw-r--r--
2023-07-26 17:26
out-i.ri
2.54
KB
-rw-r--r--
2023-07-26 17:26
parse-c.ri
449
B
-rw-r--r--
2023-07-26 17:26
pretty-c.ri
711
B
-rw-r--r--
2023-07-26 17:26
print-i.ri
398
B
-rw-r--r--
2023-07-26 17:26
rfc1123_date-c.ri
404
B
-rw-r--r--
2023-07-26 17:26
stdinput-i.ri
205
B
-rw-r--r--
2023-07-26 17:26
stdoutput-i.ri
208
B
-rw-r--r--
2023-07-26 17:26
unescape-c.ri
383
B
-rw-r--r--
2023-07-26 17:26
unescapeElement-c.ri
632
B
-rw-r--r--
2023-07-26 17:26
unescapeHTML-c.ri
382
B
-rw-r--r--
2023-07-26 17:26
unescape_element-c.ri
242
B
-rw-r--r--
2023-07-26 17:26
unescape_html-c.ri
233
B
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalClass[iI"CGI:EF@I"Object;Fo:RDoc::Markup::Document:@parts[o;;[eS:RDoc::Markup::Heading: leveli: textI" Overview;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[ I"PThe Common Gateway Interface (CGI) is a simple protocol for passing an HTTP;TI"Prequest from a web server to a standalone program, and returning the output;TI"Pto the web browser. Basically, a CGI program is called with the parameters;TI"Kof the request passed in either in the environment (GET) or via $stdin;TI"K(POST), and everything it prints to $stdout is returned to the client.;T@o; ;[I"JThis file holds the CGI class. This class provides functionality for;TI"Nretrieving HTTP request parameters, managing cookies, and generating HTML;TI"output.;T@o; ;[I"NThe file CGI::Session provides session management functionality; see that;TI"class for more details.;T@o; ;[I"ISee http://www.w3.org/CGI/ for more information on the CGI protocol.;T@S; ; i;I"Introduction;T@o; ;[ I"QCGI is a large class, providing several categories of methods, many of which;TI"Rare mixed in from other modules. Some of the documentation is in this class,;TI"Isome in the modules CGI::QueryExtension and CGI::HtmlExtension. See;TI"QCGI::Cookie for specific information on handling cookies, and cgi/session.rb;TI"0(CGI::Session) for information on sessions.;T@o; ;[I"IFor queries, CGI provides methods to get at environmental variables,;TI"Rparameters, cookies, and multipart request data. For responses, CGI provides;TI"4methods for writing output and generating HTML.;T@o; ;[I"DRead on for more details. Examples are provided at the bottom.;T@S; ; i;I"Queries;T@o; ;[ I"DThe CGI class dynamically mixes in parameter and cookie-parsing;TI"Cfunctionality, environmental variable access, and support for;TI"Cparsing multipart requests (including uploaded files) from the;TI" CGI::QueryExtension module.;T@S; ; i;I"Environmental Variables;T@o; ;[I"HThe standard CGI environmental variables are available as read-only;TI"Mattributes of a CGI object. The following is a list of these variables:;T@o:RDoc::Markup::Verbatim;[I"=AUTH_TYPE HTTP_HOST REMOTE_IDENT ;FI"<CONTENT_LENGTH HTTP_NEGOTIATE REMOTE_USER ;FI"?CONTENT_TYPE HTTP_PRAGMA REQUEST_METHOD ;FI"<GATEWAY_INTERFACE HTTP_REFERER SCRIPT_NAME ;FI"<HTTP_ACCEPT HTTP_USER_AGENT SERVER_NAME ;FI"<HTTP_ACCEPT_CHARSET PATH_INFO SERVER_PORT ;FI"@HTTP_ACCEPT_ENCODING PATH_TRANSLATED SERVER_PROTOCOL ;FI"@HTTP_ACCEPT_LANGUAGE QUERY_STRING SERVER_SOFTWARE ;FI")HTTP_CACHE_CONTROL REMOTE_ADDR ;FI")HTTP_FROM REMOTE_HOST ;Fo; ;[I"MFor each of these variables, there is a corresponding attribute with the;TI"Dsame name, except all lower case and without a preceding HTTP_.;TI"K+content_length+ and +server_port+ are integers; the rest are strings.;T@S; ; i;I"Parameters;T@o; ;[ I"LThe method #params() returns a hash of all parameters in the request as;TI"Kname/value-list pairs, where the value-list is an Array of one or more;TI"Mvalues. The CGI object itself also behaves as a hash of parameter names;TI"Fto values, but only returns a single value (as a String) for each;TI"parameter name.;T@o; ;[I"=For instance, suppose the request contains the parameter;TI"J"favourite_colours" with the multiple values "blue" and "green". The;TI"%following behaviour would occur:;T@o;;[I"=cgi.params["favourite_colours"] # => ["blue", "green"] ;FI"2cgi["favourite_colours"] # => "blue" ;Fo; ;[I"JIf a parameter does not exist, the former method will return an empty;TI"Oarray, the latter an empty string. The simplest way to test for existence;TI"/of a parameter is by the #has_key? method.;T@S; ; i;I"Cookies;T@o; ;[I"PHTTP Cookies are automatically parsed from the request. They are available;TI"Kfrom the #cookies() accessor, which returns a hash from cookie name to;TI"CGI::Cookie object.;T@S; ; i;I"Multipart requests;T@o; ;[I"OIf a request's method is POST and its content type is multipart/form-data,;TI"Pthen it may contain uploaded files. These are stored by the QueryExtension;TI"Mmodule in the parameters of the request. The parameter name is the name;TI"Lattribute of the file input field, as usual. However, the value is not;TI"Ia string, but an IO object, either an IOString for small files, or a;TI"MTempfile for larger ones. This object also has the additional singleton;TI" methods:;T@o:RDoc::Markup::List: @type: NOTE:@items[o:RDoc::Markup::ListItem:@labelI"#local_path();T;[o; ;[I":the path of the uploaded file on the local filesystem;To;;I"#original_filename();T;[o; ;[I"0the name of the file on the client computer;To;;I"#content_type();T;[o; ;[I"!the content type of the file;T@S; ; i;I"Responses;T@o; ;[ I"LThe CGI class provides methods for sending header and content output to;TI"Kthe HTTP client, and mixes in methods for programmatic HTML generation;TI"Tfrom CGI::HtmlExtension and CGI::TagMaker modules. The precise version of HTML;TI"Eto use for HTML generation is specified at object creation time.;T@S; ; i;I"Writing output;T@o; ;[ I"SThe simplest way to send output to the HTTP client is using the #out() method.;TI"JThis takes the HTTP headers as a hash parameter, and the body content;TI"Ovia a block. The headers can be generated as a string using the #header();TI"Mmethod. The output stream can be written directly to using the #print();TI"method.;T@S; ; i;I"Generating HTML;T@o; ;[ I"EEach HTML element has a corresponding method for generating that;TI"Felement as a String. The name of this method is the same as that;TI"Fof the element, all lowercase. The attributes of the element are;TI"Lpassed in as a hash, and the body as a no-argument block that evaluates;TI"Fto a String. The HTML generation module knows which elements are;TI"Halways empty, and silently drops any passed-in body. It also knows;TI"Lwhich elements require matching closing tags and which don't. However,;TI"Cit does not know what attributes are legal for which elements.;T@o; ;[ I"IThere are also some additional HTML generation methods mixed in from;TI"Mthe CGI::HtmlExtension module. These include individual methods for the;TI"Kdifferent types of form inputs, and methods for elements that commonly;TI"Ntake particular attributes where the attributes can be directly specified;TI"*as arguments, rather than via a hash.;T@S; ; i;I"Examples of use;T@S; ; i;I"Get form values;T@o;;[I"require "cgi" ;FI"cgi = CGI.new ;FI"Evalue = cgi['field_name'] # <== value string for 'field_name' ;FI"7 # if not 'field_name' included, then return "". ;FI"=fields = cgi.keys # <== array of field names ;FI" ;FI"-# returns true if form has 'field_name' ;FI" cgi.has_key?('field_name') ;FI" cgi.has_key?('field_name') ;FI" cgi.include?('field_name') ;Fo; ;[I">CAUTION! cgi['field_name'] returned an Array with the old;TI"!cgi.rb(included in ruby 1.6);T@S; ; i;I"Get form values as hash;T@o;;[I"require "cgi" ;FI"cgi = CGI.new ;FI"params = cgi.params ;Fo; ;[I"cgi.params is a hash.;T@o;;[ I"?cgi.params['new_field_name'] = ["value"] # add new param ;FI">cgi.params['field_name'] = ["new_value"] # change value ;FI">cgi.params.delete('field_name') # delete param ;FI"Ccgi.params.clear # delete all params ;FS; ; i;I"Save form values to file;T@o;;[ I"require "pstore" ;FI"!db = PStore.new("query.db") ;FI"db.transaction do ;FI"! db["params"] = cgi.params ;FI" end ;FS; ; i;I""Restore form values from file;T@o;;[ I"require "pstore" ;FI"!db = PStore.new("query.db") ;FI"db.transaction do ;FI"! cgi.params = db["params"] ;FI" end ;FS; ; i;I"Get multipart form values;T@o;;[I"require "cgi" ;FI"cgi = CGI.new ;FI"Evalue = cgi['field_name'] # <== value string for 'field_name' ;FI"5value.read # <== body of value ;FI"Cvalue.local_path # <== path to local file of value ;FI"Bvalue.original_filename # <== original filename of value ;FI"=value.content_type # <== content_type of value ;Fo; ;[I"6and value has StringIO or Tempfile class methods.;T@S; ; i;I"Get cookie values;T@o;;[ I"require "cgi" ;FI"cgi = CGI.new ;FI"9values = cgi.cookies['name'] # <== array of 'name' ;FI"1 # if not 'name' included, then return []. ;FI"?names = cgi.cookies.keys # <== array of cookie names ;Fo; ;[I"and cgi.cookies is a hash.;T@S; ; i;I"Get cookie objects;T@o;;[I"require "cgi" ;FI"cgi = CGI.new ;FI"%for name, cookie in cgi.cookies ;FI"& cookie.expires = Time.now + 30 ;FI" end ;FI"1cgi.out("cookie" => cgi.cookies) {"string"} ;FI" ;FI"Ccgi.cookies # { "name1" => cookie1, "name2" => cookie2, ... } ;FI" ;FI"require "cgi" ;FI"cgi = CGI.new ;FI"1cgi.cookies['name'].expires = Time.now + 30 ;FI"9cgi.out("cookie" => cgi.cookies['name']) {"string"} ;FS; ; i;I">Print http header and html string to $DEFAULT_OUTPUT ($>);T@o;;["I"require "cgi" ;FI";cgi = CGI.new("html3") # add HTML generation methods ;FI"cgi.out() do ;FI" cgi.html() do ;FI"* cgi.head{ cgi.title{"TITLE"} } + ;FI" cgi.body() do ;FI" cgi.form() do ;FI"( cgi.textarea("get_text") + ;FI" cgi.br + ;FI" cgi.submit ;FI" end + ;FI" cgi.pre() do ;FI" CGI::escapeHTML( ;FI"8 "params: " + cgi.params.inspect + "\n" + ;FI": "cookies: " + cgi.cookies.inspect + "\n" + ;FI"- ENV.collect() do |key, value| ;FI". key + " --> " + value + "\n" ;FI" end.join("") ;FI" ) ;FI" end ;FI" end ;FI" end ;FI" end ;FI" ;FI"## add HTML generation methods ;FI"#CGI.new("html3") # html3.2 ;FI"-CGI.new("html4") # html4.01 (Strict) ;FI"1CGI.new("html4Tr") # html4.01 Transitional ;FI",CGI.new("html4Fr") # html4.01 Frameset;F: @fileI"lib/cgi.rb;T;0[[ I"accept_charset;FI"R;F:publicFI"lib/cgi/core.rb;T[[I"TABLE_FOR_ESCAPE_HTML__;Fo;;[o; ;[I";The set of special characters and their escaped values;T;0I"lib/cgi/util.rb;T[I"RFC822_DAYS;Fo;;[o; ;[I"7Abbreviated day-of-week names specified by RFC 822;T;0@?[I"RFC822_MONTHS;Fo;;[o; ;[I"1Abbreviated month names specified by RFC 822;T;0@?[I"CR;Fo;;[o; ;[I"String for carriage return;T;0@6[I"LF;Fo;;[o; ;[I"String for linefeed;T;0@6[I"EOL;Fo;;[o; ;[I"'Standard internet newline sequence;T;0@6[I" REVISION;Fo;;[ ;0@6[I"NEEDS_BINMODE;Fo;;[o; ;[I":Whether processing will be required in binary vs text;T;0@6[I"PATH_SEPARATOR;Fo;;[o; ;[I"/Path separators in different environments.;T;0@6[I"HTTP_STATUS;Fo;;[o; ;[I"HTTP status codes.;T;0@6[I"MAX_MULTIPART_LENGTH;Fo;;[o; ;[I"-Maximum content length of multipart data;T;0@6[I"MAX_MULTIPART_COUNT;Fo;;[o; ;[I"8Maximum number of request parameters when multipart;T;0@6[ [[I" class;F[[;[[I"accept_charset;F@6[I"accept_charset=;F@6[I"escape;F@?[I"escapeElement;F@?[I"escapeHTML;F@?[I"escape_element;F@?[I"escape_html;F@?[I"new;F@6[I" parse;F@6[I"pretty;F@?[I"rfc1123_date;F@?[I" unescape;F@?[I"unescapeElement;F@?[I"unescapeHTML;F@?[I"unescape_element;F@?[I"unescape_html;F@?[:protected[ [:private[ [I" instance;F[[;[[I"header;F@6[I"out;F@6[I" print;F@6[;[ [;[[I"env_table;F@6[I" stdinput;F@6[I"stdoutput;F@6