📄 savevoip.c
字号:
#include<sys/types.h>#include<stdio.h>#include <string.h>#define PATH "/config/sip/" main(){ FILE *fconf; //configure file //open configure file char filename[100]; strcpy(filename,PATH); strcat(filename,"sip.webconf"); if ((fconf= fopen(filename, "w")) == NULL) { printf("Contenttype:text/html\n\n"); printf("<html>\n"); printf("<head><title>write configire file</title></head>\n"); printf("<body><br>\n"); printf("Error in open configire file to write.\n"); printf("</body><br>\n"); printf("</html>\n"); fflush(stdout); exit(1); };int i;int n;char c;int var_num=0;if (getenv("CONTENT_LENGTH"))n=atoi(getenv("CONTENT_LENGTH"));for (i=0; i<n;i++){ c=getchar();if (c=='&') { putc('\n',fconf); var_num++; if (var_num==8) break;} else if (c=='=') putc(' ',fconf); else putc(c,fconf); }//end for printf("Contenttype:text/html\n\n"); printf("<html>\n"); printf("<head><title>write configire file</title></head>\n"); printf("<body><br>\n"); //printf("<meta http-equiv=\"Refresh\" content=\"5;url=VoipCfg.cgi\">"); printf("<h3 align=\"center\"> <font color=\"blue\">Grand Chips </font></h3>\n"); printf("<h1 align=\"center\"> <font color=\"green\">SIP PHONE</font> </h1>\n"); printf("<hr></hr>\n"); printf("write configire file successful.\n"); printf("<BR>\n"); printf("<BR>\n"); printf("<BR>\n"); printf("<hr></hr>\n"); printf("<br>广州天河区五山华南理工大学北校区国家大学科技园1号楼N306室 Tel:(020)38743868"); printf("<br> Copyright@http://www.grandchips.com all rights reserved"); printf("</body><br>\n"); printf("</html>\n"); fflush(stdout);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -