?? server.pl
字號(hào):
#! /usr/bin/perl use strict;use Tie::File;require "error.pl";my $QueryString = $ENV{'QUERY_STRING'};my @NameValuePairs = split(/&/,$QueryString);my $Name;my $Value;my $NameValue;my $Juage;my $CountFile = "i2c";print "Content-type: text/html\n\n"; #抽空寫(xiě)一句html頭my $o = tie my @text,'Tie::File',$CountFile or die "Cannot Tie file:$CountFile \n";($Name,$Value) = split (/,/, $o->FETCH(0));my $password = $Value;for( my $i = 0; $i < 19; $i ++ ){ if( $i != 0 && $i < 3 ) { $i = 3; } foreach $NameValue ( @NameValuePairs[$i] ) { ($Name,$Value) = split (/=/, $NameValue ); if( $Name == "password" && $Value != $password && $i == 0 ) { &error("密碼輸入錯(cuò)誤!"); $i = 19; $Juage = 1; } elsif( $Value > 255 && $i != 0 ) { &error("IP數(shù)據(jù)輸入超出范圍!"); $i = 19; $Juage = 1; } else { $Juage = 0; } }}if( $Juage == 0 ){ open (COUNT, ">$CountFile"); foreach $NameValue ( @NameValuePairs ) { ($Name,$Value) = split (/=/, $NameValue ); if( $Value == "" ) { $Value = 0; } print COUNT "$Name,$Value\n"; } close (COUNT);($Name, $Value) = split (/,/, $o->FETCH(1));my $ID = $Value;($Name, $Value) = split (/,/, $o->FETCH(2));my $version = $Value;($Name, $Value) = split (/,/, $o->FETCH(3));my $IP_1 = $Value;($Name, $Value) = split (/,/, $o->FETCH(4));my $IP_2 = $Value;($Name, $Value) = split (/,/, $o->FETCH(5));my $IP_3 = $Value;($Name, $Value) = split (/,/, $o->FETCH(6));my $IP_4 = $Value;($Name, $Value) = split (/,/, $o->FETCH(7));my $mask_1 = $Value;($Name, $Value) = split (/,/, $o->FETCH(8));my $mask_2 = $Value;($Name, $Value) = split (/,/, $o->FETCH(9));my $mask_3 = $Value;($Name, $Value) = split (/,/, $o->FETCH(10));my $mask_4 = $Value;($Name, $Value) = split (/,/, $o->FETCH(11));my $gateway_1 = $Value;($Name, $Value) = split (/,/, $o->FETCH(12));my $gateway_2 = $Value;($Name, $Value) = split (/,/, $o->FETCH(13));my $gateway_3 = $Value;($Name, $Value) = split (/,/, $o->FETCH(14));my $gateway_4 = $Value;($Name, $Value) = split (/,/, $o->FETCH(15));my $DNS_1 = $Value;($Name, $Value) = split (/,/, $o->FETCH(16));my $DNS_2 = $Value;($Name, $Value) = split (/,/, $o->FETCH(17));my $DNS_3 = $Value;($Name, $Value) = split (/,/, $o->FETCH(18));my $DNS_4 = $Value;($Name, $Value) = split (/,/, $o->FETCH(19));my $power = $Value;($Name, $Value) = split (/,/, $o->FETCH(20));my $MAC_1 = $Value;($Name, $Value) = split (/,/, $o->FETCH(21));my $MAC_2 = $Value;($Name, $Value) = split (/,/, $o->FETCH(22));my $MAC_3 = $Value;($Name, $Value) = split (/,/, $o->FETCH(23));my $MAC_4 = $Value;($Name, $Value) = split (/,/, $o->FETCH(24));my $MAC_5 = $Value;($Name, $Value) = split (/,/, $o->FETCH(25));my $MAC_6 = $Value;print <<END_OF_PAGE;<HTML><HEAD> <TITLE>深圳遠(yuǎn)望谷讀寫(xiě)器系統(tǒng)</TITLE> <style type="text/css"> <!-- body,td,th { font-family: "新宋體"; font-size: 14px; } .STYLE1 { font-family: "仿宋_GB2312"; font-size: 18px; } .STYLE3 { font-size: 16; } body { background-color: #FFFFFF; } --> </style><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /></HEAD><form id="form1" name="form1" method="get" action = "/cgi-bin/welcome.cgi"><body> <div align="center"> <table width="102%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="13%"> </td> <td width="23%"><div align="right"><img src="../image/logo.bmp" /></div></td> <td width="19%"><div align="right"><img src="../image/nanshanlibmap.gif" height="88" /></div></td> <td width="30%"><div align="left"><img src="../image/web_4.gif" width="233" height="88" /></div></td> <td width="15%"> </td> </tr> <tr> <td width="13%"> </td> <td colspan="3"><img src="../image/web2_30.gif" width="100%" height="16" align="bottom" /></td> <td width="15%"> </td> </tr> </table> <table width="81%" height="286" border="1" cellpadding="1" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#FFFBFF"> <tr> <td width="160" rowspan="10"><div align="right"><img src="../image/web2_25.gif" width="17" height="270" /></div></td> <td height="34" colspan="2"><div align="center" class="STYLE1">讀寫(xiě)器配置</div></td> <td width="172" rowspan="10"><div align="left"><img src="../image/web2_25.gif" width="17" height="270" /></div></td> </tr> <tr> <td height="15"><div align="right" class="STYLE3"> <div align="right">讀寫(xiě)器ID:</div> </div></td> <td height="15"><div align="center">$ID</div></td> </tr> <tr> <td height = "15"><div align = "right" class = "STYLE3"> <div align="right">讀寫(xiě)器版本:</div> </div></td> <td height = "15"><div align="center">$version</div></td> </tr> <tr> <td height="15"><div align="right" class="STYLE3"> <div align="right">IP地址:</div> </div></td> <td height="15"><div align="center">$IP_1.$IP_2.$IP_3.$IP_4</div></td> </tr> <tr> <td height = "15"><div align = "right" class = "STYLE3"> <div align="right">子網(wǎng)掩碼:</div> </div></td> <td height = "15"><div align="center">$mask_1.$mask_2.$mask_3.$mask_4</div></td> </tr> <tr> <td height = "15"><div align = "right" class = "STYLE3"> <div align="right">網(wǎng)關(guān):</div> </div></td> <td height = "15"><div align="center">$gateway_1.$gateway_2.$gateway_3.$gateway_4</div></td> </tr> <tr> <td height = "15"><div align = "right" class = "STYLE3"> <div align="right">DNS地址:</div> </div></td> <td height = "15"><div align="center">$DNS_1.$DNS_2.$DNS_3.$DNS_4</div></td> </tr> <tr> <td height="15"><div align="right" class="STYLE3"> <div align="right">功率:</div> </div></td> <td height="15"><div align="center">$power</div></td> </tr> <tr> <td height="15"><div align="right" class="STYLE3"> <div align="right">MAC地址:</div> </div></td> <td height="15"><div align="center">$MAC_1.$MAC_2.$MAC_3.$MAC_4.$MAC_5.$MAC_6</div></td> </tr> <tr> <td height="60" colspan="2"><div align="right" class="STYLE3"> <label> <div align="center"> <input name="ok" type="submit" class="STYLE1" id="ok" value="重新配置" /> <input name="cancel" type="button" class="STYLE1" id="cancel" value="返回" onclick="location.href='../'"/> </div> </label> </div> <div align="center"></div> </td> </tr> <tr> <td height="8" colspan="4"><img src="../image/web2_30.gif" width="100%" height="18" align="top" /></td> </tr> <tr> <td colspan="4"><img src="../image/head.gif" width="100%" /></td> </tr> </table></div></form></body></HTML>END_OF_PAGE}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -