⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch10_07.htm

📁 by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<dt><b><tt class="literal">-onUnload=&gt;'$</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>-&gt;startform([<em class="replaceable">method, action, encoding</em>])</pre><p><a name="INDEX-1705" />Generates a<tt class="literal">&lt;FORM&gt;</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-&gt;startform(-method=&gt;<em class="replaceable"><tt>$method</tt></em>,                        -action=&gt;<em class="replaceable"><tt>$action</tt></em>,                        -encoding=&gt;<em class="replaceable"><tt>$encoding</tt></em>,                        -name=&gt;<em class="replaceable"><tt>$name</tt></em>,                        -target=&gt;<em class="replaceable"><tt>frame</tt></em>,                        -onSubmit=&gt;<em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-name=&gt;</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=&gt;</tt><em class="replaceable">frame</em> </b></dt><dd>Writes to the specified frame</p></dd><dt><b><tt class="literal">-onSubmit=&gt;</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>-&gt;start_multipart_form([<em class="replaceable">method, action</em>])</pre><p><a name="INDEX-1706" />Generates<tt class="literal">&lt;HTML&gt;</tt> and <tt class="literal">&lt;BODY&gt;</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>-&gt;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-&gt;submit(-name=&gt;'<em class="replaceable"><tt>name</tt></em>',                     -value=&gt;'<em class="replaceable"><tt>value</tt></em>',                     -onClick=&gt;<em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-onClick=&gt;</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>-&gt;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-&gt;textarea(-name=&gt;'<em class="replaceable"><tt>name</tt></em>',                       -default=&gt;'<em class="replaceable"><tt>value</tt></em>',                       -rows=&gt;<em class="replaceable"><tt>rows</tt></em>,                       -columns=&gt;<em class="replaceable"><tt>columns</tt></em>,                       -override=&gt;1,                       -onChange=&gt;<em class="replaceable"><tt>function</tt></em>,                       -onFocus=&gt;<em class="replaceable"><tt>function</tt></em>,                       -onBlur=&gt;<em class="replaceable"><tt>function</tt></em>,                       -onSelect=&gt;<em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-override=&gt;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=&gt;</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=&gt;</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=&gt;</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=&gt;</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>-&gt;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-&gt;textfield(-name=&gt;'<em class="replaceable"><tt>name</tt></em>',                        -default=&gt;'<em class="replaceable"><tt>value</tt></em>',                        -size=&gt;<em class="replaceable"><tt>size</tt></em>,                        -maxlength=&gt;<em class="replaceable"><tt>maxlength</tt></em>,                        -override=&gt;1,                        -onChange=&gt;<em class="replaceable"><tt>function</tt></em>,                        -onFocus=&gt;<em class="replaceable"><tt>function</tt></em>,                        -onBlur=&gt;<em class="replaceable"><tt>function</tt></em>,                        -onSelect=&gt;<em class="replaceable"><tt>function</tt></em>);</pre></blockquote><dl><dt><b><tt class="literal">-override=&gt;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=&gt;</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=&gt;</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=&gt;</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=&gt;</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>-&gt;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>-&gt;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 + -