00000008.htm

来自「一份很好的linux入门资料」· HTM 代码 · 共 87 行

HTM
87
字号
<HTML><HEAD>  <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人:&nbsp;xcec&nbsp;(money),&nbsp;信区:&nbsp;Linux&nbsp;<BR>标&nbsp;&nbsp;题:&nbsp;guestbook--&gt;guanli.cpp&nbsp;<BR>发信站:&nbsp;BBS&nbsp;水木清华站&nbsp;(Mon&nbsp;Jan&nbsp;17&nbsp;13:12:21&nbsp;2000)&nbsp;WWW-POST&nbsp;<BR>&nbsp;<BR>#include&nbsp;&lt;iostream.h&gt;
&nbsp;<BR>#include&nbsp;&lt;stdlib.h&gt;
&nbsp;<BR>#include&nbsp;&lt;ctype.h&gt;
&nbsp;<BR>#include&nbsp;&lt;string.h&gt;
&nbsp;<BR>#include&nbsp;&quot;datafile.h&quot;
&nbsp;<BR>#include&nbsp;&quot;cgi.h&quot;
&nbsp;<BR>
&nbsp;<BR>#define&nbsp;PASSWORD&nbsp;&quot;xxxxxx&quot;
&nbsp;<BR>
&nbsp;<BR>void&nbsp;printerror(void);
&nbsp;<BR>
&nbsp;<BR>int&nbsp;main()
&nbsp;<BR>{
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CGI&nbsp;cgi;
&nbsp;<BR>
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(cgi.argnum&nbsp;&lt;&nbsp;1)&nbsp;{
&nbsp;<BR>	printerror();
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;1;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;<BR>
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;strcmp(cgi.namevalue[0].value,&nbsp;PASSWORD)&nbsp;)&nbsp;{
&nbsp;<BR>	printerror();
&nbsp;<BR>	return&nbsp;1;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;<BR>
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;*p&nbsp;=&nbsp;cgi.namevalue[1].value;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(&nbsp;*p&nbsp;&amp;&amp;&nbsp;isdigit(*p)&nbsp;)
&nbsp;<BR>	p++;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;*p&nbsp;)&nbsp;{
&nbsp;<BR>	printerror();
&nbsp;<BR>	return&nbsp;1;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;<BR>
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;DATAFILE&nbsp;datafile;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;datafile.del_record(&nbsp;atoi(cgi.namevalue[1].value)&nbsp;);
&nbsp;<BR>
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;Content-Type:&nbsp;text/html\n\n&quot;;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;html&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;head&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;title&gt;&lt;/title&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;meta&nbsp;http-equiv=refresh&nbsp;content=\&quot;0;url=guestbook.cgi\&quot;&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;/head&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;body&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;p&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;p&gt;&lt;a&nbsp;href=\&quot;guestbook.cgi\&quot;&gt;&lt;/a&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;/body&gt;&lt;/html&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;0;
&nbsp;<BR>}
&nbsp;<BR>
&nbsp;<BR>void&nbsp;printerror(void)
&nbsp;<BR>{
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;Content-Type:&nbsp;text/html\n\n&quot;;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;html&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;head&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;title&gt;&lt;/title&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;/head&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;body&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;p&gt;,&nbsp;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;p&gt;&lt;a&nbsp;href=\&quot;guanli.html\&quot;&gt;&lt;/a&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;&lt;/body&gt;&lt;/html&gt;&quot;&lt;&lt;endl;
&nbsp;<BR>}&nbsp;<BR>&nbsp;<BR>--&nbsp;<BR>※&nbsp;来源:·BBS&nbsp;水木清华站&nbsp;smth.org·[FROM:&nbsp;162.105.33.162]&nbsp;&nbsp;<BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>

⌨️ 快捷键说明

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