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

📄 ch10_07.htm

📁 by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See
💻 HTM
📖 第 1 页 / 共 5 页
字号:
The URL of the image for the image map.</p></dd><dt><i><em class="replaceable"><tt>align</tt></em></i></dt><dd>The alignment type. May be <tt class="literal">TOP</tt>,<tt class="literal">BOTTOM</tt>, or <tt class="literal">MIDDLE</tt>. Using namedparameters, the syntax is:</p><blockquote><pre class="code">print $query-&gt;image_button(-name=&gt;'<em class="replaceable"><tt>name</tt></em>',                           -src=&gt;'<em class="replaceable"><tt>url</tt></em>',                           -align=&gt;'<em class="replaceable"><tt>align</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-1682" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>import_names</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;import_names('<em class="replaceable">package</em>')</pre><p><a name="INDEX-1682" />Creates variables in the specifiedpackage. Called <tt class="literal">import</tt> in older versions ofCGI.pm.</p><dl><dt><i><em class="replaceable"><tt>package</tt></em></i></dt><dd>The package to import names into</p></dd></dl></div><a name="INDEX-1683" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>isindex</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;isindex([<em class="replaceable">action</em>])</pre><p><a name="INDEX-1683" />Generates an<tt class="literal">&lt;ISINDEX&gt;</tt> tag.</p><dl><dt><i><em class="replaceable"><tt>action</tt></em></i></dt><dd>The URL of the index script. Default is the current URL. Using namedparameters, the syntax is:</p><blockquote><pre class="code">print $query-&gt;isindex(-action=&gt;<em class="replaceable"><tt>$action</tt></em>);</pre></blockquote></dd></dl></div><a name="INDEX-1684" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>keywords</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">keyarray</em> = $<em class="replaceable">query</em>-&gt;keywords(  )</pre><p>Retrieves keywords from an <tt class="literal">&lt;ISINDEX&gt;</tt> search.</p><dl><dt><b><tt class="literal">@</tt><em class="replaceable">keyarray</em></b></dt><dd>The array that will contain the retrieved keywords</p></dd></dl></div><a name="INDEX-1685" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>nph</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>nph(1)</pre><p><a name="INDEX-1685" />Treats a CGI script as ano-parsed-header (NPH) script.</p></div><a name="INDEX-1686" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>param</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">name</em> = $<em class="replaceable">query</em>-&gt;param([<em class="replaceable">parameter</em> [<em class="replaceable">newvalue1, newvalue2</em>, ...] ])</pre><p><a name="INDEX-1686" />Gets or sets parameter names.</p><dl><dt><b><tt class="literal">@</tt><em class="replaceable">name</em></b></dt><dd>The array that will contain the parameter names.</p></dd><dt><i><em class="replaceable"><tt>parameter</tt></em></i></dt><dd>An optional single parameter to fetch. When used with no arguments,<tt class="literal">param</tt> returns a list of all known parameter names.</p></dd><dt><i><em class="replaceable"><tt>newvalue1, newvalue2</tt></em>, ...</i></dt><dd>The optional new values to assign to the parameter. Using namedparameters, the syntax is:</p><blockquote><pre class="code">$query-&gt;param(-name=&gt;'<em class="replaceable"><tt>parameter</tt></em>',              -value=&gt;'<em class="replaceable"><tt>newvalue</tt></em>');</pre></blockquote><p>or: </p><blockquote><pre class="code">$query-&gt;param(-name=&gt;'<em class="replaceable"><tt>parameter</tt></em>',              -values=&gt;'<em class="replaceable"><tt>newvalue1</em>', '<em class="replaceable">newvalue2</tt></em>', ...);</pre></blockquote></dd></dl></div><a name="INDEX-1687" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>password_field</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;password_field('<em class="replaceable">name</em>' [,'<em class="replaceable">value</em>',<em class="replaceable">size</em>,<em class="replaceable">maxlength</em> ])</pre><p><a name="INDEX-1687" />Generates a password 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 default password to place in the password field.</p></dd><dt><i><em class="replaceable"><tt>size</tt></em></i></dt><dd>The size of the password field (in characters).</p></dd><dt><i><em class="replaceable"><tt>maxlength</tt></em></i></dt><dd>The maximum length of the password field (in characters). Using namedparameters, the syntax is:</p><blockquote><pre class="code">print $query-&gt;password_field(-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-1688" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>path_info</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>path_info(  )</pre><p><a name="INDEX-1688" />Returns extra path information.</p></div><a name="INDEX-1689" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>path_translated</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>path_translated(  )</pre><p><a name="INDEX-1689" />Returns translated extra pathinformation.</p></div><a name="INDEX-1690" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>popup_menu</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;popup_menu('<em class="replaceable">name</em>', <tt class="literal">\@</tt><em class="replaceable">array</em> [,'<em class="replaceable">selected</em>', \%<em class="replaceable">labelhash</em>])</pre><p><a name="INDEX-1690" />Generates a popup menu.</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><b><tt class="literal">\@</tt><em class="replaceable">array</em></b></dt><dd>An array reference listing the menu items. You can also use ananonymous array reference (see example below).</p></dd><dt><i><em class="replaceable"><tt>selected</tt></em></i></dt><dd>The menu item to be initially selected (default is first menu item orthe item selected in previous queries).</p></dd><dt><b><tt class="literal">\%</tt><em class="replaceable">labelhash</em></b></dt><dd>A hash reference listing labels for each menu item. Default is menuitem text. For example:</p><blockquote><pre class="code">%labels = ('UPS'=&gt;'United Parcel Service (UPS)',         'FedExO'=&gt;'Federal Express Overnight - 10AM delivery',         'FedExS'=&gt;'Federal Express Standard - 2PM delivery',         'FedEx2'=&gt;'Federal Express 2nd Day Delivery');print $query-&gt;popup_menu('delivery_method',                        ['UPS', 'FedExO', 'FedExS', 'FedEx2'],                        'FedExO',                        \%labels);</pre></blockquote><p>Using named parameters, the syntax is: </p><blockquote><pre class="code">print $query-&gt;popup_menu(-name=&gt;'<em class="replaceable"><tt>name</tt></em>',                         -values=&gt;\<em class="replaceable"><tt>@array</tt></em>,                         -default=&gt;'<em class="replaceable"><tt>selected</tt></em>',                         -labels=&gt;\%<em class="replaceable"><tt>labelhash</tt></em>,                         -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>);</pre></blockquote><dl><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 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></dl></dd></dl></div><a name="INDEX-1691" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>radio_group</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;radio_group('<em class="replaceable">name</em>', \@<em class="replaceable">list</em> [, <em class="replaceable">selected</em>, 'true', \%<em class="replaceable">label</em> ])</pre><p><a name="INDEX-1691" />Generates a set of radio buttons.</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><b><tt class="literal">\@</tt><em class="replaceable">list</em></b></dt><dd>An array reference with the list items. You can also use an anonymousarray reference.</p></dd><dt><i><em class="replaceable"><tt>selected</tt></em></i></dt><dd>The menu item to be initially selected.</p></dd><dt><b><tt class="literal">'true'</tt></b></dt><dd>Inserts newlines between radio buttons.</p></dd><dt><b><tt class="literal">\%</tt><em class="replaceable">label</em></b></dt><dd>A hash reference listing labels for each list item. Default is thelist text itself. (See <tt class="literal">popup_menu</tt> for an example.)Using named parameters, the syntax is:</p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -