index.c
资源名称:cgi-web.rar [点击查看]
上传用户:sxdewei
上传日期:2014-06-02
资源大小:67k
文件大小:2k
源码类别:
嵌入式Linux
开发平台:
Unix_Linux
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <getopt.h>
- #include <errno.h>
- #include <sys/ioctl.h>
- #include <linux/config.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- //<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
- //<META HTTP-EQUIV="expires" CONTENT="-1">
- static char adminGate[] = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/frameset.dtd">
- <HTML><HEAD><TITLE>IPCAMER</TITLE>
- <META http-equiv="Content-Type" content="text/html; charset=gb2312">
- <META content="MSHTML 6.00.6000.16414" name=GENERATOR>
- </HEAD>
- <FRAMESET border=0
- frameSpacing=0 rows=* frameBorder=NO>
- <FRAMESET border=0
- frameSpacing=0 frameBorder=NO cols=129,*,0><FRAME name=leftFrame
- src="menus.htm" noResize><FRAME name=mainFrame
- src="/sysinfo.cgi"><FRAME name=msgFrame
- src="about:blank"></FRAMESET></FRAMESET></HTML>nn";
- //static char userGate[] = "Location: rt_video.cginn";
- static char userGate[] = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/frameset.dtd">
- <HTML><HEAD><TITLE>IPCAMER</TITLE>
- <!--
- <META http-equiv="Content-Type" content="text/html; charset=gb2312">
- -->
- <META content="MSHTML 6.00.6000.16414" name=GENERATOR>
- </HEAD>
- <FRAMESET border=0
- frameSpacing=0 rows=* frameBorder=NO>
- <FRAMESET border=0
- frameSpacing=0 frameBorder=NO *,*,0><FRAME name=mainFrame
- src="/rt_video.cgi"><FRAME name=msgFrame
- src="about:blank"></FRAMESET></FRAMESET></HTML>nn
- ";
- int main(void)
- {
- char * userName = getenv("REMOTE_USER");
- if(!strcmp("admin",userName))
- {
- printf("%sn",adminGate);
- }
- else if(!strcmp("user",userName))
- {
- printf("%sn",userGate);
- }
- fflush(stdout);
- exit(0);
- } // end of main