📄 ch10_07.htm
字号:
<dt><b><tt class="literal">-onUnload=>'$</tt><em class="replaceable">function</em><tt class="literal">'</tt> </b></dt><dd>Browser should execute specified function upon leaving page.</p></dd></dl></div><a name="INDEX-1705" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>startform</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>print $<em class="replaceable">query</em>->startform([<em class="replaceable">method, action, encoding</em>])</pre><p><a name="INDEX-1705" />Generates a<tt class="literal"><FORM></tt> tag.</p><dl><dt><i><em class="replaceable"><tt>method</tt></em></i></dt><dd>The request method for the form. Values are:</p><dl><dt><b><tt class="literal">POST</tt></b></dt><dd>Use the POST method (default).</p></dd><dt><b><tt class="literal">GET</tt></b></dt><dd>Use the GET method.</p></dd></dl></dd><dt><i><em class="replaceable"><tt>action</tt></em></i></dt><dd>The URL of the CGI script. Default is the current URL.</p></dd><dt><i><em class="replaceable"><tt>encoding</tt></em></i></dt><dd>The encoding scheme. Possible values are<tt class="literal">application/x-www-form-urlencoded</tt> and<tt class="literal">multipart/form-data</tt>. Using named parameters, thesyntax is:</p><blockquote><pre class="code">print $query->startform(-method=><em class="replaceable"><tt>$method</tt></em>, -action=><em class="replaceable"><tt>$action</tt></em>, -encoding=><em class="replaceable"><tt>$encoding</tt></em>, -name=><em class="replaceable"><tt>$name</tt></em>, -target=><em class="replaceable"><tt>frame</tt></em>, -onSubmit=><em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-name=></tt><em class="replaceable">name</em> </b></dt><dd>Names the form for identification by JavaScript functions</p></dd><dt><b><tt class="literal">-target=></tt><em class="replaceable">frame</em> </b></dt><dd>Writes to the specified frame</p></dd><dt><b><tt class="literal">-onSubmit=></tt><em class="replaceable">function</em> </b></dt><dd>A JavaScript function that the browser should execute upon submittingthe form</p></dd></dl></dd></dl></div><a name="INDEX-1706" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>start_multipart_form</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>print $<em class="replaceable">query</em>->start_multipart_form([<em class="replaceable">method, action</em>])</pre><p><a name="INDEX-1706" />Generates<tt class="literal"><HTML></tt> and <tt class="literal"><BODY></tt>tags. Same as <tt class="literal">startform</tt>, but assumes<tt class="literal">multipart/form-data</tt> encoding as the default.</p></div><a name="INDEX-1707" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>submit</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>print $<em class="replaceable">query</em>->submit([ '<em class="replaceable">label</em>'<em class="replaceable">,</em>'<em class="replaceable">value</em>' ])</pre><p><a name="INDEX-1707" />Generates a Submit button.</p><dl><dt><i><em class="replaceable"><tt>label</tt></em></i></dt><dd>The label to use for the button.</p></dd><dt><i><em class="replaceable"><tt>value</tt></em></i></dt><dd>The value to return when the form is submitted. Using namedparameters, the syntax is:</p><blockquote><pre class="code">print $query->submit(-name=>'<em class="replaceable"><tt>name</tt></em>', -value=>'<em class="replaceable"><tt>value</tt></em>', -onClick=><em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-onClick=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when theuser clicks on the image</p></dd></dl></dd></dl></div><a name="INDEX-1708" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>textarea</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>print $<em class="replaceable">query</em>->textarea('<em class="replaceable">name</em>' [,'<em class="replaceable">value</em>',<em class="replaceable">rows,columns</em> ])</pre><p><a name="INDEX-1708" />Generates a large multiline text inputbox.</p><dl><dt><i><em class="replaceable"><tt>name</tt></em></i></dt><dd>The name to assign the input to (required).</p></dd><dt><i><em class="replaceable"><tt>value</tt></em></i></dt><dd>The initial value to place into the text input box.</p></dd><dt><i><em class="replaceable"><tt>rows</tt></em></i></dt><dd>The number of rows to display.</p></dd><dt><i><em class="replaceable"><tt>columns</tt></em></i></dt><dd>The number of columns to display. Using named parameters, the syntaxis:</p><blockquote><pre class="code">print $query->textarea(-name=>'<em class="replaceable"><tt>name</tt></em>', -default=>'<em class="replaceable"><tt>value</tt></em>', -rows=><em class="replaceable"><tt>rows</tt></em>, -columns=><em class="replaceable"><tt>columns</tt></em>, -override=>1, -onChange=><em class="replaceable"><tt>function</tt></em>, -onFocus=><em class="replaceable"><tt>function</tt></em>, -onBlur=><em class="replaceable"><tt>function</tt></em>, -onSelect=><em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-override=>1</tt> </b></dt><dd>Text field should not inherit its value from a previous invocation ofthe script</p></dd><dt><b><tt class="literal">-onChange=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when theuser changes the text field</p></dd><dt><b><tt class="literal">-onFocus=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when thefocus is on the text field</p></dd><dt><b><tt class="literal">-onBlur=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when thefocus leaves the text field</p></dd><dt><b><tt class="literal">-onSelect=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when theuser changes a selected portion of the text field</p></dd></dl></dd></dl></div><a name="INDEX-1709" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>textfield</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>print $<em class="replaceable">query</em>->textfield('<em class="replaceable">name</em>' [,'<em class="replaceable">value</em>', <em class="replaceable">size, maxlength</em>])</pre><p><a name="INDEX-1709" />Generates a text input field.</p><dl><dt><i><em class="replaceable"><tt>name</tt></em></i></dt><dd>The name to assign the input to (required).</p></dd><dt><i><em class="replaceable"><tt>value</tt></em></i></dt><dd>The initial value to place in the text field.</p></dd><dt><i><em class="replaceable"><tt>size</tt></em></i></dt><dd>The size of the text field (in characters).</p></dd><dt><i><em class="replaceable"><tt>maxlength</tt></em></i></dt><dd>The maximum length of the text field (in characters). Using namedparameters, the syntax is:</p><blockquote><pre class="code">print $query->textfield(-name=>'<em class="replaceable"><tt>name</tt></em>', -default=>'<em class="replaceable"><tt>value</tt></em>', -size=><em class="replaceable"><tt>size</tt></em>, -maxlength=><em class="replaceable"><tt>maxlength</tt></em>, -override=>1, -onChange=><em class="replaceable"><tt>function</tt></em>, -onFocus=><em class="replaceable"><tt>function</tt></em>, -onBlur=><em class="replaceable"><tt>function</tt></em>, -onSelect=><em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-override=>1</tt> </b></dt><dd>Text field should not inherit its value from a previous invocation ofthe script</p></dd><dt><b><tt class="literal">-onChange=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when theuser changes the text field</p></dd><dt><b><tt class="literal">-onFocus=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when thefocus is on the text field</p></dd><dt><b><tt class="literal">-onBlur=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when thefocus leaves the text field</p></dd><dt><b><tt class="literal">-onSelect=></tt><em class="replaceable">function</em> </b></dt><dd>Browser should execute <em class="replaceable"><tt>function</tt></em> when theuser changes a selected portion of the text field</p></dd></dl></dd></dl></div><a name="INDEX-1710" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>url</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">url</em> = $<em class="replaceable">query</em>->url</pre><p><a name="INDEX-1710" />Returns a URL of the current scriptwithout query information.</p></div><a name="INDEX-1711" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>use_named_parameters</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>use_named_parameters( )</pre><p><a name="INDEX-1711" />Specifies that functions should takenamed parameters.</p></div><a name="INDEX-1712" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>user_agent</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">query</em>->user_agent( [<em class="replaceable">string</em>] )</pre><p><a name="INDEX-1712" />Returns the value of theHTTP_USER_AGENT header.</p><dl><dt><i><em class="replaceable"><tt>string</tt></em></i></dt><dd>If specified, returns only headers matching the specified string</p></dd></dl></div><a name="INDEX-1713" /><a name="INDEX-1714" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>user_name</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>user_name( )</pre><p><a name="INDEX-1713" />Returns the remoteuser's login name; unreliable.<a name="INDEX-1714" /></p></div><hr width="684" align="left" /><div class="navbar"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -