亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch04_01.htm

?? 用perl編寫CGI的好書。本書從解釋CGI和底層HTTP協議如何工作開始
?? HTM
字號:
<?label 4. Forms and CGI?><html><head><title>Forms and CGI (CGI Programming with Perl)</title><link href="../style/style1.css" type="text/css" rel="stylesheet" /><meta name="DC.Creator" content="Scott Guelich, Gunther Birznieks and Shishir Gundavaram" /><meta scheme="MIME" content="text/xml" name="DC.Format" /><meta content="en-US" name="DC.Language" /><meta content="O'Reilly & Associates, Inc." name="DC.Publisher" /><meta scheme="ISBN" name="DC.Source" content="1565924193L" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="CGI Programming with Perl" /><meta content="Text.Monograph" name="DC.Type" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" alt="Book Home" usemap="#banner-map" border="0" /><map name="banner-map"><area alt="CGI Programming with Perl" href="index.htm" coords="0,0,466,65" shape="rect" /><area alt="Search this book" href="jobjects/fsearch.htm" coords="467,0,514,18" shape="rect" /></map><div class="navbar"><table border="0" width="515"><tr><td width="172" valign="top" align="left"><a href="ch03_04.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td width="171" valign="top" align="center"><a href="index.htm">CGI Programming with Perl</a></td><td width="172" valign="top" align="right"><a href="ch04_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><hr align="left" width="515" /><h1 class="chapter">Chapter 4. Forms and CGI</h1><div class="htmltoc"><h4 class="tochead">Contents:</h4><p><a href="ch04_01.htm">Sending Data to the Server</a><br><a href="ch04_02.htm">Form Tags</a><br><a href="ch04_03.htm">Decoding Form Input</a><br></p></div><p><a name="INDEX-727" /> <a name="INDEX-728" />HTMLforms are the user interface that provides input to your CGI scripts.They are primarily used for two purposes:<a name="INDEX-729" /><a name="INDEX-730" />collecting <a name="INDEX-731" />data and accepting<a name="INDEX-732" />commands. Examples of data you collectmay include registration information, payment information, and onlinesurveys. You may also collect commands via forms, such as usingmenus, checkboxes, lists, and buttons to control various aspects ofyour application. In many cases, your forms will include elements forboth: collecting data as well as application control.</p><p>A great advantage of HTML forms is that you can use them to create afrontend for numerous gateways (such as databases or otherinformation servers) that can be accessed by any client withoutworrying about platform dependency.</p><p>In order to process data from an HTML form, the browser must send thedata via an HTTP request. A CGI script cannot check user input on theclient side; the user must press the submit button and the input canonly be validated once it has travelled to the server. JavaScript, onthe other hand, can perform actions in the browser. It can be used inconjunction with CGI scripts to provide a more responsive userinterface. We will see how to do this in <a href="ch07_01.htm">Chapter 7, "JavaScript"</a>.</p><p>This chapter covers:</p><ul><li><p>How form data is sent to the server</p></li><li><p>How to use HTML tags for writing forms</p></li><li><p>How CGI scripts decode the form data</p></li></ul><div class="sect1"><a name="ch04-84856" /><h2 class="sect1">4.1. Sending Data to the Server</h2><p>In the last <a name="INDEX-733" /> <a name="INDEX-734" /> <a name="INDEX-735" />couple of chapters, we havereferred to the options that a browser can include with an HTTPrequest. In the case of a <a name="INDEX-736" /><a name="INDEX-737" /> <a name="INDEX-738" /><a name="INDEX-739" />GET request, these options areincluded as the <a name="INDEX-740" /> <a name="INDEX-741" />query string portion of the URL passed inthe request line. In the case of a <a name="INDEX-742" /><a name="INDEX-743" />POST request, these options areincluded as the content of the HTTP request. These options aretypically generated by HTML forms.</p><p>Each HTML form <a name="INDEX-744" />element has an associated name andvalue, like this checkbox:</p><blockquote><pre class="code">&lt;INPUT TYPE="checkbox" NAME="send_email" VALUE="yes"&gt;</pre></blockquote><p>If this checkbox is checked, then the option<tt class="literal">send_email</tt> with a value of <tt class="literal">yes</tt>is sent to the web server. Other form elements, which we will look atin a moment, act similarly. Before the browser can send form optiondata to the server, the browser must encode it. There are currentlytwo different forms of encoding form data. The default encoding,which has the <a name="INDEX-745" /><a name="INDEX-746" /><a name="INDEX-747" />mediatype of <tt class="command">application/x-www-form-urlencoded</tt>, is usedalmost exclusively. The other form of encoding,<em class="emphasis">multipart/form-data,</em><a name="INDEX-748" /><a name="INDEX-749" /><a name="INDEX-750" /> isprimarily used with forms which allow the user to upload files to theweb server. We will look at this in <a href="ch05_02.htm#ch05-67561">Section 5.2.4, "File Uploads with CGI.pm"</a>.</p><p>For now, let's look at how<tt class="command">application/x-www-form-urlencoded</tt> works. As wementioned, each HTML form element has a name and a value attribute.First, the browser collects the names and values for each element inthe form. It then takes these strings and encodes them according tothe same rules for encoding <a name="INDEX-751" /><a name="INDEX-752" />URL text that we discussed in <a href="ch02_01.htm">Chapter 2, "The Hypertext Transport Protocol "</a>. If you recall, characters that have specialmeaning for <a name="INDEX-753" /> <a name="INDEX-754" /> <a name="INDEX-755" />HTTP are replaced with a percentagesymbol and a two-digit hexadecimal number;<a name="INDEX-756" /> <a name="INDEX-757" />spaces are replaced with<tt class="literal">+</tt>. For example, the string "Thanks for thehelp!" would be converted to"Thanks+for+the+help%21".</p><p>Next, the browser joins each <a name="INDEX-758" />name and value with an equals sign. Forexample, if the user entered "30" when asked for the age,the key-value pair would be "age=30". Each<a name="INDEX-759" /><a name="INDEX-760" /> <a name="INDEX-761" />key-value pair is then joined, using the"&amp;" character as a delimiter. Here is an example ofan <a name="INDEX-762" />HTML form:</p><blockquote><pre class="code">&lt;HTML&gt;&lt;HEAD&gt;  &lt;TITLE&gt;Mailing List&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;Mailing List Signup&lt;/H1&gt;&lt;P&gt;Please fill out this form to be notified via email about   updates and future product announcements.&lt;/P&gt;&lt;FORM ACTION="/cgi/register.cgi" METHOD="POST"&gt;  &lt;P&gt;    Name: &lt;INPUT TYPE="TEXT" NAME="name"&gt;&lt;BR&gt;    Email: &lt;INPUT TYPE="TEXT" NAME="email"&gt;  &lt;/P&gt;    &lt;HR&gt;  &lt;INPUT TYPE="SUBMIT" VALUE="Submit Registration Info"&gt;&lt;/FORM&gt;&lt;/BODY&gt;&lt;/HTML&gt;</pre></blockquote><p><a href="ch04_01.htm#ch04-83168">Figure 4-1</a> shows how the form looks in Netscapewith some sample input.</p><a name="ch04-83168" /><div class="figure"><img width="443" src="figs/cgi2.0401.gif" height="213" alt="Figure 4-1" /></div><h4 class="objtitle">Figure 4-1. Sample HTML form</h4><p>When this form is submitted, the browser encodes these three elementsas:</p><blockquote><pre class="code">name=Mary+Jones&amp;email=mjones%40jones.com</pre></blockquote><p>Since the <a name="INDEX-763" /><a name="INDEX-764" />request method is POST in thisexample, this string would be added to the HTTP request as thecontent of that message. The HTTP request message would look likethis:</p><blockquote><pre class="code">POST /cgi/register.cgi HTTP/1.1Host: localhostContent-Length: 67Content-Type: application/x-www-form-urlencodedname=Mary+Jones&amp;email=mjones%40jones.com</pre></blockquote><p>If the request method were set to <a name="INDEX-765" />GET, then the <a name="INDEX-766" /> <a name="INDEX-767" /> <a name="INDEX-768" />request would beformatted this way instead:</p><blockquote><pre class="code">GET /cgi/register.cgi?name=Mary+Jones&amp;email=mjones%40jones.com HTTP/1.1Host: localhost</pre></blockquote></div><hr align="left" width="515" /><div class="navbar"><table border="0" width="515"><tr><td width="172" valign="top" align="left"><a href="ch03_04.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td width="171" valign="top" align="center"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td width="172" valign="top" align="right"><a href="ch04_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td width="172" valign="top" align="left">3.4. Examples</td><td width="171" valign="top" align="center"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td width="172" valign="top" align="right">4.2. Form Tags</td></tr></table></div><hr align="left" width="515" /><img src="../gifs/navbar.gif" alt="Library Navigation Links" usemap="#library-map" border="0" /><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2001</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area href="../index.htm" coords="1,1,83,102" shape="rect" /><area href="../lnut/index.htm" coords="81,0,152,95" shape="rect" /><area href="../run/index.htm" coords="172,2,252,105" shape="rect" /><area href="../apache/index.htm" coords="238,2,334,95" shape="rect" /><area href="../sql/index.htm" coords="336,0,412,104" shape="rect" /><area href="../dbi/index.htm" coords="415,0,507,101" shape="rect" /><area href="../cgi/index.htm" coords="511,0,601,99" shape="rect" /></map></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品福利视频一区二区三区| 91亚洲精华国产精华精华液| 亚洲乱码国产乱码精品精小说| 91麻豆精品国产91久久久久久久久 | 日韩理论在线观看| 日韩三级精品电影久久久| 99re8在线精品视频免费播放| 久久国产精品99精品国产| 香港成人在线视频| 一区二区三区在线观看欧美| 国产精品高潮呻吟久久| 欧美经典一区二区| 久久这里只精品最新地址| 7777精品伊人久久久大香线蕉最新版| 国产91精品一区二区麻豆亚洲| 日韩精彩视频在线观看| 亚洲成a人v欧美综合天堂 | 中文字幕一区在线观看视频| 精品美女在线观看| 久久毛片高清国产| 久久久91精品国产一区二区精品| 日韩欧美国产综合在线一区二区三区 | 国产精品的网站| 中文在线资源观看网站视频免费不卡| 国产女人aaa级久久久级 | 久久99深爱久久99精品| 六月婷婷色综合| 国产成人h网站| av亚洲精华国产精华| 99久久伊人精品| 91视频一区二区| 欧美日本视频在线| 日韩你懂的在线观看| 久久精品日产第一区二区三区高清版 | 日本不卡一区二区三区高清视频| 性做久久久久久免费观看欧美| 日本伊人精品一区二区三区观看方式| 蜜桃av一区二区三区| 久久99国内精品| 成人国产亚洲欧美成人综合网 | 中文字幕国产一区| 国产精品天美传媒| 亚洲国产精品黑人久久久 | 成人av先锋影音| 日本精品一级二级| 884aa四虎影成人精品一区| 亚洲精品一区二区三区蜜桃下载 | 洋洋成人永久网站入口| 日本va欧美va精品| 成人av在线电影| 欧美日韩精品欧美日韩精品一| 精品国精品国产| 亚洲精品高清在线| 免费av网站大全久久| eeuss鲁一区二区三区| 在线播放欧美女士性生活| 欧美激情资源网| 亚洲a一区二区| 豆国产96在线|亚洲| 欧美性大战久久久| 国产人伦精品一区二区| 亚洲二区在线观看| 99精品视频在线播放观看| 日韩欧美国产1| 一区二区三区电影在线播| 国产精品一二三| 欧美亚洲丝袜传媒另类| 亚洲色图色小说| 国产福利视频一区二区三区| 欧美色图12p| 国产精品久久久久久户外露出| 天堂午夜影视日韩欧美一区二区| 成人丝袜18视频在线观看| 欧美一级久久久久久久大片| 一个色在线综合| av网站免费线看精品| 国产亚洲一本大道中文在线| 日本不卡一二三| 欧美午夜寂寞影院| 伊人一区二区三区| 成人av电影观看| 精品区一区二区| 亚洲一区二区三区四区五区黄| 韩国精品久久久| 日韩欧美亚洲国产精品字幕久久久| 亚洲.国产.中文慕字在线| 欧美日韩国产经典色站一区二区三区| 一区二区三区在线视频播放 | 国产精品三级久久久久三级| 麻豆精品视频在线观看免费| 精品视频在线免费观看| 亚洲免费观看高清在线观看| 成人中文字幕在线| 国产精品另类一区| 色欲综合视频天天天| 自拍偷拍欧美精品| 日本久久电影网| 亚洲国产欧美在线人成| 欧美午夜一区二区三区| 亚洲二区在线观看| 91精品国产91久久综合桃花| 石原莉奈在线亚洲三区| 欧美成人一区二区三区在线观看 | 欧美三级中文字| 亚洲国产日韩在线一区模特| 欧美午夜精品久久久| 日韩电影一区二区三区| 精品国产3级a| 成人小视频在线| 亚洲欧美激情一区二区| 欧美午夜电影在线播放| 理论片日本一区| 国产精品国产三级国产aⅴ中文| 91视视频在线观看入口直接观看www | 亚洲黄色片在线观看| 精品污污网站免费看| 日日欢夜夜爽一区| 久久久久国色av免费看影院| 99久久精品国产一区| 婷婷一区二区三区| 久久影院视频免费| 色老综合老女人久久久| 亚洲大型综合色站| 久久精品一区二区| 欧美色综合网站| 美女一区二区三区在线观看| 国产精品网站在线播放| 欧美疯狂做受xxxx富婆| 国产乱子轮精品视频| 一区二区三区四区蜜桃 | 国产精品1024久久| 亚洲在线中文字幕| 久久久精品免费免费| 91视频一区二区| 免费不卡在线观看| 亚洲私人黄色宅男| 欧美不卡一区二区三区| 色哟哟国产精品| 国产精品一区不卡| 肉丝袜脚交视频一区二区| 国产精品久久久久久久久图文区 | 日韩欧美一级二级| 91极品美女在线| 国产盗摄精品一区二区三区在线 | 伊人性伊人情综合网| 26uuu国产电影一区二区| 在线视频国产一区| 不卡电影一区二区三区| 久久99九九99精品| 日韩影院精彩在线| 亚洲午夜免费电影| 亚洲人成在线观看一区二区| 久久久精品影视| 久久午夜国产精品| 欧美精品色一区二区三区| 91麻豆精品视频| 国产伦精品一区二区三区免费| 一区二区久久久久| 自拍偷自拍亚洲精品播放| 欧美精品一区二区三| 欧美肥胖老妇做爰| 欧美亚一区二区| 91福利精品第一导航| 91亚洲国产成人精品一区二区三| 国产成人精品一区二区三区四区| 久久狠狠亚洲综合| 久久99九九99精品| 国产麻豆日韩欧美久久| 国产精品自产自拍| 丰满少妇在线播放bd日韩电影| 韩国毛片一区二区三区| 久国产精品韩国三级视频| 麻豆国产一区二区| 麻豆精品在线看| 国产一区欧美日韩| 久久精品久久精品| 国产美女精品在线| 91福利区一区二区三区| 日韩免费在线观看| 亚洲欧美成aⅴ人在线观看| 亚洲大片在线观看| 国产精品一区二区果冻传媒| 色狠狠桃花综合| 26uuu亚洲| 亚洲一区二区三区四区中文字幕| 免费精品视频在线| 成人久久久精品乱码一区二区三区| a亚洲天堂av| 日韩女优电影在线观看| 亚洲欧美一区二区三区孕妇| 蜜桃视频在线观看一区二区| 北条麻妃国产九九精品视频| 亚洲欧美自拍偷拍| 亚洲色图视频网| 激情综合色播激情啊| 色欧美88888久久久久久影院| 日韩精品中文字幕一区 | 亚洲超碰97人人做人人爱| 国产一区二区三区免费在线观看| 91官网在线观看|