parse(query) Class Public methods Parse an HTTP query string into a hash of key=>value pairs. params = CGI::parse("query_string") # {"name1" => ["value1", "value2", ...], # "name2" => ["value1", "value2", ...], ... }
CGI.new(tag_maker) { block }CGI.new(options_hash = {}) { block } Class Public methods Create a new CGI instance. tag_maker This is the same as using the options_hash form with the value { :tag_maker => tag_maker } Note that it is recommended to use the options_hash form, since it also allows you specify the charset you will accept. options_hash A Hash that recognizes two options: :accept_charset specifies encoding of received query string. If omitted, @@accept_charset
escape_html(str) Class Public methods Synonym for ::escapeHTML
escape_element(str) Class Public methods Synonym for ::escapeElement
escapeHTML(string) Class Public methods Escape special characters in HTML, namely &"<> CGI::escapeHTML('Usage: foo "bar" <baz>') # => "Usage: foo "bar" <baz>"
escapeElement(string, *elements) Class Public methods Escape only the tags of certain HTML elements in string. Takes an element or elements or array of elements. Each element is specified by the name of the element, without angle brackets. This matches both the start and the end tag of that element. The attribute list of the open tag will also be escaped (for instance, the double-quotes surrounding attribute values). print CGI::escapeElement('<BR><A HREF="url"></A&g
escape(string) Class Public methods URL-encode a string. url_encoded_string = CGI::escape("'Stop!' said Fred") # => "%27Stop%21%27+said+Fred"
accept_charset=(accept_charset) Class Public methods Set the accept character set for all new CGI instances.
accept_charset() Class Public methods Return the accept character set for all new CGI instances.
update() Instance Public methods Store session data on the server. For some session storage types, this is a no-op.
Page 2220 of 2275