?? setip.cgi.c
字號(hào):
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>int main(){ char *lenstr; char *string="textfield="; //char ip[]="ifconfig eth0 "; char *a; char arg1[20]; char input[1024]; //char *ip="192.168.18.120"; printf("Content-Type:text/html\n\n"); printf("<TITLE>設(shè)置系統(tǒng)IP地址</TITLE>\n"); printf("<HR>"); lenstr = getenv("CONTENT_LENGTH"); if(!lenstr) printf("<P>Sorry..\n</P>"); else{ fgets(input,1024,stdin); if(memcmp(input,string,10)==0){ //printf("<P>find ip\n"); } a = strstr(input,string); sscanf(a,"%*[^=]=%[^&]",&arg1); //printf("%s\n\n",&arg1); execlp("ifconfig","ifconfig","eth0","192.168.18.118",(char *)0); printf("<P>您已經(jīng)成功設(shè)置了系統(tǒng)的IP地址!</P>"); printf("<P>您設(shè)置系統(tǒng)的IP地址:%s</P>",arg1); printf("</br>"); printf("<a href=../sys_form.html>返回首頁</a>"); } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -