- 论坛徽章:
- 0
|
重新整理过了,希望前辈帮我看看,谢谢了!!!
puts("<table width='780' border='0' align='center' bgcolor='#43668B'>"
"<tr>"
"<td colspan='3'>"
);
cgi_include("head.inc");
puts("</td>"
"</tr>"
"<tr>"
"<td height='3' colspan='3'>"
" "
"</td>"
"</tr>"
"<tr>"
"<td width='144' rowspan='3'>"
);
cgi_include("left.inc");
puts("</td>"
"<td height='22' width='650' colspan='2' bgcolor='#43668B'>"
">>系统设置--系统基本设置"
"</td>"
"</tr>"
"<tr>"
"<td width='0'>"
" "
"</td>"
"<td width='650'>");
puts("<table width='500' border='0'align='center'cellpadding='0' cellspacing='0'>"
"<form action='sysjb.cgi' method='pos' name='FrontPage_Form1'>");
if(cgi_param("Submit")){
puts("<tr>""<td align='center'>IP地址配置</td>""</tr>"
"<tr>"
"<td width='120' bgcolor='#43668B' align='right'>IP地址 :</td>");
puts( "<td colspan='2' align='left' bgcolor='#43668B'>");
netmask=cgi_param("netmask");
gataway=cgi_param("gataway");
dns=cgi_param("dns");
ip1=cgi_param("ip1");
ip2=cgi_param("ip2");
ip3=cgi_param("ip3");
ip4=cgi_param("ip4");
puts("<input name=ip1 type=text class='line' size='3' maxlength='3' value=");
printf ("'%s' ",ip1);
puts(">.");
puts("<input type=text class='line' name=ip2 size='3' maxlength='3' value=");
printf("'%s'",ip2);
puts(">.");
puts("<input type=text class='line' name=ip3 size='3' maxlength='3' value=");
printf("'%s'",ip3);
puts(">.");
puts("<input type=text class='line' name=ip4 size='3' maxlength='3' value=");
printf("'%s'",ip4);
puts(">");
puts( "</td>"
"</tr>"
"<tr>"
"<td bgcolor='#43668B' align='right' width='120'>子网掩码:</td>"
"<td colspan='2' align='left' bgcolor='#43668B'>"
"<input name='netmask' type='text' class='line' id='netmask' size='18' maxlength='15' value=");
printf("'%s'",netmask);
puts(">");
puts( "</td>"
"</tr>"
"<tr>"
"<td bgcolor='#43668B' align='right' width='120'>网 关 :</td>"
"<td colspan='2' align='left' bgcolor='#43668B'>"
"<input name='gataway' type='text' class='line' id='gataway' size='18' maxlength='15' value=");
printf("%s",gataway);
puts(">");
puts("</td>"
"</tr>"
"<tr>"
"<td bgcolor='#43668B' align='right' width='120'><p>DNS地址 :</p></td>"
"<td colspan='2' align='left' bgcolor='#43668B'>"
"<input name='dns' type='text' class='line' id='dns' value=");
printf("'%s'",dns);
puts(" size='18' maxlength=15>"
);
puts("</td>"
"</tr>"
"<tr>"
"<td bgcolor='#43668B' align='right' width='120'> </td>"
"<td colspan='2' bgcolor='#43668B'> </td>"
"</tr>"
"<tr>"
"<td bgcolor='#43668B' align='right' width='120'> </td>"
"<td colspan='2' align='left' bgcolor='#43668B'><input type='submit' name='Submit' value='SUBMIT'>");
puts ("<input type='reset' name='Submit2' value='RESET'>"
"</td>"
"</tr>");
puts("</form>"
"</table>"
);
puts("</td>"
"</tr>"
"<tr>"
"<td colspan='2'>"
"</td>"
"</tr>"
"<tr>"
"<td height='18' colspan='3' align='center'>");
cgi_include("copyright.inc");
puts("</td>"
"</tr>"
"</table>");
cgi_include("map.inc");
r1=CheckIp(netmask);
r2=CheckIp(gataway);
r3=CheckIp(dns);
p1=IsIp(ip1);
p2=IsIp(ip2);
p3=IsIp(ip3);
p4=IsIp(ip4);
/*if(p1!=0 && p2!=0 && p3!=0 && p4!=0){
fp=fopen("dat\\ip.dat","w");
str=strcat(ip1,".");
str=strcat(str,ip2);
str=strcat(str,".");
str=strcat(str,ip3);
str=strcat(str,".");
str=strcat(str,ip4);
fputs(str,fp);
fclose(fp);
}
if(r1!=0){
fp=fopen("dat\\netmask.dat","w");
str=netmask;
str=str_replace(str," ","");
fputs(str,fp);
fclose(fp);
}
if(r2!=0){
fp=fopen("dat\\gataway.dat","w");
str=gataway;
str=str_replace(str," ","");
fputs(str,fp);
fclose(fp);
}
if(r3!=0){
fp=fopen("dat\\dns.dat","w");
str=dns;
str=str_replace(str," ","");
fputs(str,fp);
fclose(fp);
}*/
/* fp=fopen("dat\\ip.dat","r");
fread(str,1000,1,fp);
fclose(fp);
ar=explode(ipall,".",&i);
ip1=ar[0];
ip2=ar[1];
ip3=ar[2];
ip4=ar[3];
fp=fopen("dat/netmask.dat","r");
fread(str,1000,1,fp);
fclose(fp);
fp=fopen("dat/gataway.dat","r");
fread(str2,1000,1,fp);
fclose(fp);
fp=fopen("dat/dns.dat","r");
fread(str3,1000,1,fp);
fclose(fp);*/ |
|