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

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

?? ch06_02.htm

?? 用perl編寫CGI的好書。本書從解釋CGI和底層HTTP協議如何工作開始
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<p><tt class="literal">%e</tt></p></td><td><p>Date</p></td><td><p>1</p></td></tr><tr><td><p><tt class="literal">%H</tt></p></td><td><p>24-hour clock hour</p></td><td><p>13</p></td></tr><tr><td><p><tt class="literal">%I</tt></p></td><td><p>12-hour clock hour</p></td><td><p>01</p></td></tr><tr><td><p><tt class="literal">%j</tt></p></td><td><p>Decimal day of the year</p></td><td><p>360</p></td></tr><tr><td><p><tt class="literal">%m</tt></p></td><td><p>Month number</p></td><td><p>11</p></td></tr><tr><td><p><tt class="literal">%M</tt></p></td><td><p>Minutes</p></td><td><p>08</p></td></tr><tr><td><p><tt class="literal">%p</tt></p></td><td><p>AM | PM</p></td><td><p>AM</p></td></tr><tr><td><p><tt class="literal">%r</tt></p></td><td><p>Time as <tt class="literal">%I:%M:%S %p</tt></p></td><td><p>07:17:39 PM</p></td></tr><tr><td><p><tt class="literal">%S</tt></p></td><td><p>Seconds</p></td><td><p>09</p></td></tr><tr><td><p><tt class="literal">%T</tt></p></td><td><p>24-hour time as <tt class="literal">%H:%M:%S</tt></p></td><td><p>16:55:15</p></td></tr><tr><td><p><tt class="literal">%U</tt></p></td><td><p>Week of the year (also <tt class="literal">%W</tt>)</p></td><td><p>49</p></td></tr><tr><td><p><tt class="literal">%w</tt></p></td><td><p>Day of the week number</p></td><td><p>5</p></td></tr><tr><td><p><tt class="literal">%y</tt></p></td><td><p>Year of the century</p></td><td><p>95</p></td></tr><tr><td><p><tt class="literal">%Y</tt></p></td><td><p>Year</p></td><td><p>1995</p></td></tr><tr><td><p><tt class="literal">%Z</tt></p></td><td><p>Time zone</p></td><td><p>EST</p></td></tr></table></div><a name="ch06-24838" /><div class="sect2"><h3 class="sect2">6.2.5. Including Boilerplates</h3><p><a name="INDEX-1323" /><a name="INDEX-1324" /><a name="INDEX-1325" /> <a name="INDEX-1,326" /><a name="INDEX-1327" />Thereare times when you will have certain information that you repeat innumerous documents on the server such as a copyright notice, thewebmaster's email address, etc. Instead of maintaining thisinformation separately in each file, you can include one file thathas all of this information. It is much easier to update a singlefile if this information changes (for example, you may need to updatethe copyright notice the beginning of next year). <a href="ch06_02.htm#ch06-54923">Example 6-1</a> shows an example of such a file that itselfcontains SSI commands (note the <em class="emphasis">.shtml</em>extension).</p><a name="ch06-54923" /><div class="example"><h4 class="objtitle">Example 6-1. footer.shtml </h4><blockquote><pre class="code">&lt;HR&gt;&lt;P&gt;&lt;FONT SIZE="-1"&gt;Copyright 1999-2000 by My Company, Inc.&lt;BR&gt;Please report any problems to  &lt;A HREF="mailto:&lt;!--#echo var="SERVER_ADMIN"--&gt;"&gt;  &lt;!--#echo var="SERVER_ADMIN"--&gt;&lt;/A&gt;.&lt;BR&gt;This document was last modified on &lt;!--#echo var="LAST_MODIFIED"--&gt;.&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;</pre></blockquote></div><p>It may look messy to include an SSI command within another HTML tag,but don't worry about this being invalid HTML because the webserver will parse it before it sends it to the client. Also, you maywonder if we were to include this file in another file which file theserver uses to determine the <a name="INDEX-1328" />LAST_MODIFIEDvariable. LAST_MODIFIED is set once by the server for the file thatthe client requested. If that file includes other files, such as<em class="filename">footer.shtml</em>, LAST_MODIFIED will still refer tothe original file; so this footer will do what we want.</p><p>Because included<a name="INDEX-1329" />files are not complete HTMLdocuments (they have no &lt;HTML&gt;, &lt;HEAD&gt;, or &lt;BODY&gt;tags), it can be easier to maintain these files if you differentiatethem by creating a standard extension for them or keeping them in aparticular directory. In our example we'll create a foldercalled <em class="emphasis">/includes</em> in the documentroot and place <em class="emphasis">footer.shtml</em> here. We can theninclude the file by adding the following line to other<em class="filename">.shtml</em> files:</p><blockquote><pre class="code">&lt;!--#include virtual="/includes/footer.shtml" --&gt;</pre></blockquote><p>This SSI command will be replaced with a footer containing acopyright notice, the email address of the server administrator, andthe modification date of the file requested.</p><p>You can also use the<tt class="command">file</tt><a name="INDEX-1330" /> attribute insteadof <tt class="command">virtual</tt> to reference the file, but<tt class="command">file</tt> has limitations. You cannot use absolutepaths, the web server does no processing on the requested file (e.g.,for CGI scripts or other SSI commands), and you may not referencefiles outside the document root. This last restriction preventssomeone from including a file like <em class="filename">/etc/passwd</em>in an HTML document (since it's possible that someone is ableto upload files to a server without otherwise having access to thisfile). Given these restrictions, it's typically easier tosimply use <tt class="command">virtual</tt>.</p></div><a name="ch06-13635" /><div class="sect2"><h3 class="sect2">6.2.6. Executing CGI Programs</h3><p><a name="INDEX-1331" /> <a name="INDEX-1,332" /><a name="INDEX-1333" />You can use Server Side Includes toembed the results of an entire CGI program into a static HTMLdocument by using either <em class="emphasis">exec cgi</em> or<em class="emphasis">include virtual</em><a name="INDEX-1334" />. This is convenient for those timeswhen you want to display just one piece of dynamic data, such as:</p><blockquote><pre class="code">This page has been accessed 9387 times.</pre></blockquote><p>Let's look at an example of inserting output from CGI programs.<a name="INDEX-1335" /> <a name="INDEX-1,336" /> <a name="INDEX-1,337" /><a name="INDEX-1338" /><a name="INDEX-1339" />Suppose youhave a simple CGI program that keeps track of the number of visitors,called using the <em class="emphasis">include</em> SSI command in an HTMLdocument:</p><blockquote><pre class="code">This page has been accessed&lt;!--#include virtual="/cgi/counter.cgi"--&gt; times.</pre></blockquote><p>We can include this tag in any SSI-enabled HTML page on our webserver; each page will have its own count. We don't need topass any variables to tell the CGI which URL we need the count for;the DOCUMENT_URI environment variable will contain the URL of theoriginal document requested. Even though this is not a standard CGIenvironment variable, the additional SSI variables are provided toCGI scripts invoked via SSI.</p><p>The code behind an access counter is quite short. A<a name="INDEX-1340" />Berkeley DB hash file on the servercontains a count of the number of visitors that have accessed eachdocument we're tracking. Whenever a user visits the document,the SSI directive in that document calls a CGI program that reads thenumerical value stored in the data file, increments it, and outputsit. The counter is shown in <a href="ch06_02.htm#ch06-66032">Example 6-2</a>.</p><a name="ch06-66032" /><div class="example"><h4 class="objtitle">Example 6-2. counter.cgi </h4><blockquote><pre class="code">#!/usr/bin/perl -wTuse strict;use Fcntl;use DB_File;use constant COUNT_FILE =&gt; "/usr/local/apache/data/counter/count.dbm";my %count;my $url = $ENV{DOCUMENT_URI};local *DBM;print "Content-type: text/plain\n\n";if ( my $db = tie %count, "DB_File", COUNT_FILE, O_RDWR | O_CREAT ) {    my $fd = $db-&gt;fd;    open DBM, "+&lt;&amp;=$fd" or die "Could not dup DBM for lock: $!";    flock DBM, LOCK_EX;    undef $db;    $count{$url} = 0 unless exists $count{$url};    my $num_hits = ++$count{$url};    untie %count;    close DBM;    print "$num_hits\n";} else {    print "[Error processing counter data]\n";}</pre></blockquote></div><p>Don't worry about how we access the hash file; we'lldiscuss this in <a href="ch10_01.htm">Chapter 10, "Data Persistence"</a>. Note that we output themedia type. You must do this for included files even though theheader is not returned to the client. An important thing to note isthat a CGI program called by an SSI directive cannot output anythingother than text because this data is embedded within the documentthat invoked the directive. As a result, it doesn't matterwhether you output a content type of <tt class="command">text/plain</tt> or<tt class="command">text/html</tt>, as the browser will interpret the datawith the media type of the calling document. Needless to say, yourCGI program cannot output graphic images or other binary data.</p></div><a name="ch06-20332" /><div class="sect2"><h3 class="sect2">6.2.7. Common Errors</h3><p><a name="INDEX-1341" /><a name="INDEX-1342" /> <a name="INDEX-1,343" /><a name="INDEX-1344" />There are a few common errors thatyou can make when using server side includes. First, you should notforget the <tt class="literal">#</tt>:</p><blockquote><pre class="code">&lt;!--echo var="REMOTE_USER" --&gt;</pre></blockquote><p>Second, do not add extra spaces between the preceding<tt class="literal">&lt;!--</tt> and <tt class="literal">#</tt>:</p><blockquote><pre class="code">&lt;!-- #echo var="REMOTE_USER" --&gt;</pre></blockquote><p>Finally, if you do not enclose the value of the final attribute in<a name="INDEX-1345" /><a name="INDEX-1346" />quotes, you may need to insert an additionalspace before the trailing <tt class="literal">--&gt;</tt>. Otherwise, theSSI parser may interpret those characters as part of theattribute's value:</p><blockquote><pre class="code">&lt;!--#echo var=REMOTE_USER--&gt;</pre></blockquote><p>Generally it is simpler and clearer to use quotes.</p><p>If you make either of the first two mistakes, the server will notrecognize the SSI command and will pass it on as an HTML comment. Inthe last case, the command will probably be replaced with <a name="INDEX-1347" /> <a name="INDEX-1,348" /> <a name="INDEX-1,349" />an<a name="INDEX-1350" />error message.</p></div><hr align="left" width="515" /><div class="navbar"><table border="0" width="515"><tr><td width="172" valign="top" align="left"><a href="ch06_01.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="ch06_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td width="172" valign="top" align="left">6. HTML Templates</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">6.3. HTML::Template</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一区二区三区免费野_久草精品视频
欧美日高清视频| 欧美在线不卡视频| 国内精品免费在线观看| 日韩不卡免费视频| 蜜臀av性久久久久蜜臀aⅴ四虎 | 午夜精品成人在线视频| 一区二区在线免费观看| 婷婷久久综合九色国产成人| 日韩成人精品视频| 国产一区二区三区四区五区美女| 免费成人在线网站| 国产精品亚洲视频| 99久久久无码国产精品| 91久久一区二区| 欧美另类z0zxhd电影| 69堂成人精品免费视频| 精品国产乱码久久久久久1区2区| 久久女同互慰一区二区三区| 国产精品理伦片| 午夜欧美2019年伦理| 久久精品噜噜噜成人88aⅴ| 国产成人综合视频| 欧美午夜电影在线播放| 精品国产乱码久久久久久浪潮 | 91精品国产91热久久久做人人| 91超碰这里只有精品国产| 日韩免费高清av| 欧美国产日韩精品免费观看| 亚洲免费观看高清完整版在线观看 | 欧美丝袜第三区| 91精品国产麻豆国产自产在线| 在线播放日韩导航| 国产亚洲人成网站| 亚洲综合免费观看高清完整版在线| 日韩电影免费在线| 91在线视频免费观看| 欧美一区在线视频| 亚洲男人天堂av网| 国产一区二区在线视频| 色综合色综合色综合色综合色综合 | 亚洲成年人影院| 国产69精品一区二区亚洲孕妇| hitomi一区二区三区精品| 欧美一级爆毛片| 亚洲激情图片小说视频| 国产.精品.日韩.另类.中文.在线.播放| 日本黄色一区二区| 欧美激情一区二区三区不卡 | 日韩精品在线看片z| 日韩久久一区二区| 国产裸体歌舞团一区二区| 91精品欧美福利在线观看| 亚洲黄色av一区| 成人黄色电影在线| 久久久久国产精品人| 日韩成人精品视频| 欧美日韩国产小视频在线观看| 国产精品久线在线观看| 国产一区福利在线| 久久综合网色—综合色88| 午夜激情一区二区三区| 色嗨嗨av一区二区三区| 国产精品高潮呻吟| 国产成a人无v码亚洲福利| 精品国产乱码久久久久久老虎| 日韩高清中文字幕一区| 欧美高清精品3d| 午夜在线成人av| 欧美视频一二三区| 亚洲第一会所有码转帖| 欧美性色黄大片| 香蕉成人啪国产精品视频综合网 | 狠狠色狠狠色综合系列| 日韩一区二区三| 青青草精品视频| 欧美成人高清电影在线| 久久国产精品99久久人人澡| 日韩欧美国产三级| 国产一区二区日韩精品| 久久精品亚洲麻豆av一区二区| 寂寞少妇一区二区三区| 国产网站一区二区| 成人动漫一区二区三区| 一区二区三区在线免费播放| 在线亚洲一区二区| 日本不卡中文字幕| 久久人人超碰精品| 波多野结衣视频一区| 一区二区成人在线观看| 日韩一区二区三区在线视频| 国产一区999| 国产精品福利一区| 欧美午夜精品久久久久久超碰| 青青草国产精品97视觉盛宴| 亚洲精品一线二线三线无人区| 粉嫩欧美一区二区三区高清影视 | 精品一区二区在线播放| 国产女同性恋一区二区| 95精品视频在线| 亚洲第四色夜色| 国产午夜亚洲精品午夜鲁丝片| 91在线视频播放| 免费成人性网站| 亚洲视频你懂的| 欧美一级搡bbbb搡bbbb| 成人一区二区三区视频| 亚洲乱码国产乱码精品精的特点| 欧美日韩中文另类| 国产乱子伦视频一区二区三区| 亚洲蜜臀av乱码久久精品| 日韩欧美一级精品久久| 97精品久久久久中文字幕 | 国产午夜精品福利| 欧美三级在线看| 国产91在线观看| 天堂精品中文字幕在线| 久久精品欧美一区二区三区不卡| 欧美三级日韩三级| 成人性生交大片免费看视频在线| 视频一区视频二区中文| 中文字幕亚洲一区二区av在线| 91精品国产综合久久精品性色| 成人av资源在线观看| 极品少妇xxxx精品少妇| 亚洲福利视频一区| 国产精品成人一区二区三区夜夜夜| 日韩欧美亚洲一区二区| 欧美在线啊v一区| 波多野结衣在线一区| 国内精品在线播放| 日韩**一区毛片| 亚洲成人你懂的| 一区二区三区四区国产精品| 中文字幕的久久| 久久综合狠狠综合久久综合88| 91精品国产入口| 精品污污网站免费看| 91丨porny丨国产入口| 成人午夜在线视频| 国产美女久久久久| 国产专区综合网| 国产高清在线精品| 国产一区二区主播在线| 国产乱国产乱300精品| 激情欧美日韩一区二区| 久久99精品网久久| 国内精品久久久久影院一蜜桃| 老司机精品视频在线| 久久精品999| 狠狠色狠狠色综合系列| 国产乱子轮精品视频| 狠狠色狠狠色综合| 国产成人免费网站| 成人a级免费电影| 色综合天天综合给合国产| 91日韩在线专区| 欧美性色aⅴ视频一区日韩精品| 日本丶国产丶欧美色综合| 色诱亚洲精品久久久久久| 欧美色综合天天久久综合精品| 在线亚洲+欧美+日本专区| 欧美日韩国产精选| 欧美一区二区三区视频在线观看| 91精品国产综合久久久久久久 | 国产色综合一区| 中文字幕av在线一区二区三区| 国产精品久久看| 亚洲制服丝袜av| 免费成人美女在线观看.| 国产一区视频导航| 国产成人啪免费观看软件| 色综合视频在线观看| 欧美日韩dvd在线观看| 2023国产精华国产精品| 国产精品视频第一区| 一区二区三区在线影院| 日韩成人免费电影| 大白屁股一区二区视频| 欧美日韩一区二区三区视频| 91精品国产色综合久久ai换脸 | 在线不卡免费av| 欧美精品一区二区三区在线| 国产精品乱码一区二三区小蝌蚪| 亚洲一区二区影院| 国产精品综合二区| 欧美专区在线观看一区| 久久亚洲影视婷婷| 亚洲专区一二三| 国产成人亚洲精品青草天美| 97精品视频在线观看自产线路二| 欧美精品乱码久久久久久| 国产亚洲一区二区三区在线观看 | 在线观看国产91| 2021国产精品久久精品| 一区二区三区高清不卡| 国产一区二区主播在线| 欧美精品一二三区| 日韩理论片一区二区| 国产一区三区三区| 在线不卡的av|