½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 193 | Á¶È¸¼ö 3,066 | µî·ÏÀÏ 2007-05-27 10:10:16

´Ð³×ÀÓ

rhtjralshan

À̸ÞÀÏ

rhtjralshan@naver.com

Á¦¸ñ

[´äº¯] ·Î±×ÀÎÇÑ ¾ÆÀ̵ð Æнº¿öµå °ªÀ» °¡Áö°í ´Ù¸¥ÆäÀÌÁö ´Ù¸¥ÆäÀÌÁö·Î °ª°¡Áö°í °¡°Ô Çß½À´Ï´Ù..
³»¿ë

¿Ö cgi c¾ð¾î ȨÆäÀÌÁö°¡ »ç¶óÁ³À»±î¿©.¤Ó.¤Ð.¤Ð

ÀÓº£µðµå¾È¿¡ À¥À» ¿¬µ¿½ÃÄÑ°¡Áö°í ÇÒ·Á°í ÇÏ´Ï±î °Å½Ã±âÇϳ׿© ÀÏ´Ü ÇØ°áÀº Çß½À´Ï´Ù. ÁÖ¼ÒÃļ­ ¸øµé¾î°¡°Ô

¹«Á¶°Ç ·Î±×ÀÎÀÇ Á¤º¸¸¦ °¡Áö°í °¡¾ß ´ÙÀ½ÆäÀÌÁö°¡ µÇ°Ô Çß½À´Ï´Ù...

Àúó·³ »¹ÁþÇÏÁö ¸¶½Ã¶ó°í ¿Ã¸³´Ï´Ù..¤Ð.¤Ð

===============================================================

//index.html

<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>tuning ade</title>
<meta name="generator" content="Namo WebEditor v6.0">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<FORM METHOD=POST ACTION="./cgi-bin/check.cgi">
  <br> ¾Æ ÀÌ µð
  <INPUT type=text name=id value="" size=10 maxlength=8>
  <br> Æнº¿öµå
  <INPUT type=password name=pass size=10 maxlength=8>
  <br><br>
  <INPUT type=submit value="È® ÀÎ">
  <INPUT type=reset  value="Ãë ¼Ò">
</FORM>
 

</body>

//////////////////////////////////////////

//check.cgi


#include <stdio.h>              /* Ç¥ÁØ Çì´õÆÄÀÏ */
#include <stdlib.h>             /* getenv() ÇÔ¼ö µîÀÇ Çì´õÆÄÀÏ */
#include <string.h>             /* ¹®ÀÚ¿­ ÇÔ¼ö Çì´õÆÄÀÏ */
#define MAX 1000               /* ÀԷº¯¼ö°¡ ÃÖ´ë 1000°³·Î °¡Á¤ */

typedef struct {                   /* entry ¶ó´Â ±¸Á¶Ã¼ÇüÀ» ¼±¾ð */
       char *name;        /* º¯¼ö¸í; INPUT¹®¿¡¼­ÀÇ name */
       char *val;            /* °ª;     INPUT¹®¿¡¼­ÀÇ value */
} entry;

int   nEntries;              /* ½ÇÁ¦ ÀԷ°ªÀÇ °³¼ö¸¦ ´ãÀ» º¯¼ö */
entry entries[MAX];             /* entryÇüÀÇ entries ¹è¿­º¯¼ö ¼±¾ð */
void  getEntries();               /* º¯¼ö ¹× °ª ÀÔ·Â ÇÔ¼ö */
void  printout();                  /* º¯¼ö ¹× °ª Ãâ·Â ÇÔ¼ö */
char *makeword (char *,  char);         /* º¯¼ö¿Í °ª ºÐ¸®ÇÔ¼ö */
char *fmakeword(FILE *, char, int *);   /* º¯¼ö¿Í °ªÀÇ ½ÖÀ» ¸¸µê */
char *qURLdecode(char *);                /* ÇÑ±Û DECODE ÇÔ¼ö */
char _x2c(char, char);                       /* 16Áø¼ö Á¶ÇÕ ÇÔ¼ö */

void file(char** id, char** password);

main()
{
      getEntries();            /* ¸Å°³º¯¼ö¸¦ Àü´Þ¹ÞÀ½ */
      printout();              /* È­¸éÃâ·Â ÇÔ¼ö¸¦ È£Ãâ */
      return 0;
}

void getEntries()
{
     register int x, m=0;
     int cl;

     /* FORM¿¡¼­ METHOD=POST·Î ÁöÁ¤µÇ¾ú´ÂÁö È®ÀÎ */
     if(strcmp(getenv("REQUEST_METHOD"), "POST")) {
 printf("Content-type: text/html%c%c", 10, 10);     //±×³É ÁÖ¼ÒÃļ­ µé¾î°¡¸é ¹Ù·Î ·Î±×ÀÎâÀ¸·Î ³Ñ±â±â
 printf("<HTML>\n");
 printf("<BODY>\n");
 printf("<script language=\"javascript\">\n");
 printf("location.href=\"../index.html\"\n");
 printf("</script>\n");
 printf("</BODY>\n");
 printf("</HTML>\n");
//           printf("ÀÌ ÇÁ·Î±×·¥À» ½ÇÇà½ÃÅ°·Á¸é FORM¹®¿¡¼­ ");
//           printf("POST ¹æ½ÄÀ» ÁöÁ¤Çؾ߸¸ ÇÕ´Ï´Ù.\n");
           exit(1);
         }
     /* TYPEÀº application/x-www-form-urlencoded À̾î¾ß ÇÔ */
     if (strcmp(getenv("CONTENT_TYPE"),
              "application/x-www-form-urlencoded")) {
 printf("Content-type: text/html%c%c", 10, 10);     //±×³É ÁÖ¼ÒÃļ­ µé¾î°¡¸é ¹Ù·Î ·Î±×ÀÎâÀ¸·Î ³Ñ±â±â
 printf("<HTML>\n");
 printf("<BODY>\n");
 printf("<script language=\"javascript\">\n");
 printf("location.href=\"../index.html\"\n");
 printf("</script>\n");
 printf("</BODY>\n");
 printf("</HTML>\n");
//              printf("ÀÌ ÇÁ·Î±×·¥Àº FORMÀÇ °á°ú¸¦ ");
//              printf("Çؼ®Çϱâ À§Çؼ­¸¸ »ç¿ëµË´Ï´Ù.\n");
              exit(1);
         }
     /* ÀԷµǴ º¯¼ö¿Í °ªÀÇ ±æÀ̸¦ ¹Þ¾ÆµéÀÓ */
     cl=atoi(getenv("CONTENT_LENGTH"));

     /* stdinÀ¸·Î ÀԷµǴ ¹®ÀÚ¿­À» º¯¼ö¿Í °ªÀ¸·Î À߶󳻾î
         entries ±¸Á¶Ã¼¿¡ ÀúÀå */
      for(x=0; cl && (!feof(stdin)); x++) {
           m=x;
           entries[x].val=fmakeword(stdin, '&', &cl);
           entries[x].name=makeword(entries[x].val, '=');
      }
      nEntries=m+1;

     /* 16Áø¼ö·Î ÄÚµåÈ­µÈ ÇѱÛÀ» ¿ø»óÅ·Πº¹¿ø */
      for (x=0; x<nEntries; x++) {
            qURLdecode(entries[x].name);
            qURLdecode(entries[x].val);
       }
}

char *fmakeword(FILE *f, char stop, int *cl)
{
      int wsize=102400, ll=0;
      char *word=(char *) malloc(sizeof(char) * (wsize+1));
      /* º¯¼ö¿Í °ªÀÇ ½ÖÀ¸·Î Àü¼Û ¹®ÀÚ¿­À» Àß¶ó³¿ */
      while(1) {
           word[ll]=(char) fgetc(f);
           if(ll==wsize) {
              word[ll+1]='\0';
              wsize+=102400;
              word=(char *) realloc(word,sizeof(char)*(wsize+1));
           }
           --(*cl);
           if((word[ll]==stop) || (feof(f)) || (!(*cl))) {
               if(word[ll] != stop) ll++;
               word[ll]='\0';
               return word;
           }
           ++ll;
       }
}

char *makeword(char *line,  char stop)
{
    int x=0, y=0;
    char *word=(char *) malloc(sizeof(char) * (strlen(line)+1));
    for(x=0; ((line[x]) && (line[x] != stop)); x++)
    word[x]=line[x];
    word[x]='\0';
    if (line[x]) ++x;
    while(line[y++]=line[x++]);
    return word;
}

char *qURLdecode(char *str)
{
    int i, j;
    if(!str) return;
       for(i=j=0; str[j]; i++, j++)
            switch(str[j]){
               /* ´õÇϱâ(+) ±âÈ£¸¦ °ø¹é(' ')À¸·Î º¯È¯ */
               case '+': str[i]=' ';
                            break;
               /* '%'·Î ½ÃÀ۵Ǵ µÎ ¹®ÀÚ¸¦ ÇÑ±Û ÇѱÛÀÚ·Î º¯È¯ */
               case '%': str[i]=_x2c(str[j+1], str[j+2]);
                             j+=2;
                             break;
            }
       str[i]='\0';
       return str;
}

char _x2c(char hex_up, char hex_low)
{
   char digit;
   /* µÎ °³ÀÇ 16Áø¼ö °ªÀ» ÇϳªÀÇ 16Áø¼ö °ªÀ¸·Î º¯È¯ÇÑ´Ù */
   digit = 16 * (hex_up  >= 'A' ?
             ((hex_up  & 0xdf) - 'A') + 10 : (hex_up  - '0'));
   digit += (hex_low >= 'A' ?
             ((hex_low & 0xdf) - 'A') + 10 : (hex_low - '0'));
   return (digit);
}

void printout()
{
   FILE  *fp;
   char* id;
   char* password;

  id = malloc(10 * sizeof(char));
   password = malloc(10 * sizeof(char));

   file(&id, &password);
   /* Ãâ·ÂµÇ´Â ³»¿ëÀÌ ÅؽºÆ® ÇüÅÂÀÇ HTML ¹®ÀåÀÓÀ» ¾Ë·ÁÁÖ¸ç,
       ÀÌÈķδ printf()¹® ³»¿¡ HTML ¸í·ÉÀ» ±â¼úÇÑ´Ù */
   printf("Content-type: text/html%c%c", 10, 10);
   printf("<HTML>\n");
   printf("<HEAD>\n");
   printf("   <TITLE> ÆĶó¸ÞÅ͵éÀÇ °ªÀ» Ãâ·ÂÇÔ </TITLE>\n");
   printf("</HEAD>\n");
   if(strcmp(id, entries[0].val)==0) //¾ÆÀ̵ð ¸í
   {
       if(strcmp(password, entries[1].val)==0) //ºñ¹Ð¹øÈ£ //¾ÆÀ̵ð ºñ¹Ð¹øÈ£ ¸ÂÀ¸¸é ÆäÀÌÁö À̵¿
       {
    printf("<BODY>\n");
    printf("<form name=\"form1\" action=\"./1.cgi\" method=\"post\">\n");
    printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ¾ÆÀ̵ð ºñ¹Ð¹øÈ£ °ª ³Ñ±â±â
    printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val);
    printf("</form>\n");
    printf("<script language=\"javascript\">\n");
    printf("document.form1.submit();\n");
       }
       else if(strcmp(password, entries[1].val)!=0) //ºñ¹Ð¹øÈ£
       {
    printf("<BODY>\n");
    printf("<script language=\"javascript\">\n");
           printf("location.href=\"../index.html\"\n");
       }
   }
   else if(strcmp(id, entries[0].val)!=0) //¾ÆÀ̵ð ¸í
   {
   printf("<BODY>\n");
   printf("<script language=\"javascript\">\n");
       printf("location.href=\"../index.html\"\n");
   }
  
//   printf("<script language=\"javascript\">\n");
//   printf("location.href=\"./1.cgi\"\n");
   printf("</script>\n");
   printf("</BODY>\n");
   printf("</HTML>\n");
   free(password);
   free(id);
}

void file(char** id, char** password)
{
 FILE *input;
 
 input = fopen("../¾ÆÀ̵ð¹×ºñ¹Ð¹øÈ£.txt", "rt");//ÆÄÀÏÀбâ

 fscanf(input, "%s", *id);
 fscanf(input, "%s", *password);
 
 fclose(input);
}

 

#include <stdio.h>              /* Ç¥ÁØ Çì´õÆÄÀÏ */
#include <stdlib.h>             /* getenv() ÇÔ¼ö µîÀÇ Çì´õÆÄÀÏ */
#include <string.h>             /* ¹®ÀÚ¿­ ÇÔ¼ö Çì´õÆÄÀÏ */
#define MAX 1000               /* ÀԷº¯¼ö°¡ ÃÖ´ë 1000°³·Î °¡Á¤ */

typedef struct {                   /* entry ¶ó´Â ±¸Á¶Ã¼ÇüÀ» ¼±¾ð */
       char *name;        /* º¯¼ö¸í; INPUT¹®¿¡¼­ÀÇ name */
       char *val;            /* °ª;     INPUT¹®¿¡¼­ÀÇ value */
} entry;

int   nEntries;              /* ½ÇÁ¦ ÀԷ°ªÀÇ °³¼ö¸¦ ´ãÀ» º¯¼ö */
entry entries[MAX];             /* entryÇüÀÇ entries ¹è¿­º¯¼ö ¼±¾ð */
void  getEntries();               /* º¯¼ö ¹× °ª ÀÔ·Â ÇÔ¼ö */
void printout();                  /* º¯¼ö ¹× °ª Ãâ·Â ÇÔ¼ö */
char *makeword (char *,  char);         /* º¯¼ö¿Í °ª ºÐ¸®ÇÔ¼ö */
char *fmakeword(FILE *, char, int *);   /* º¯¼ö¿Í °ªÀÇ ½ÖÀ» ¸¸µê */
char *qURLdecode(char *);                /* ÇÑ±Û DECODE ÇÔ¼ö */
char _x2c(char, char);                       /* 16Áø¼ö Á¶ÇÕ ÇÔ¼ö */

void file(char** id, char** password);

main()
{
 getEntries();            /* ¸Å°³º¯¼ö¸¦ Àü´Þ¹ÞÀ½ */
 printout();
 return 0;
}

void getEntries()
{
     register int x, m=0;
     int cl;

     /* FORM¿¡¼­ METHOD=POST·Î ÁöÁ¤µÇ¾ú´ÂÁö È®ÀÎ */
     if(strcmp(getenv("REQUEST_METHOD"), "POST")) {
  printf("Content-type: text/html\n\n");
  printf("<HTML>\n");
  printf("<BODY>\n");
  printf("<script language=\"javascript\">\n");
  printf("location.href=\"../index.html\"\n");
  printf("</script>\n");
  printf("</BODY>\n");
  printf("</HTML>\n");
//           printf("ÀÌ ÇÁ·Î±×·¥À» ½ÇÇà½ÃÅ°·Á¸é FORM¹®¿¡¼­ ");
//           printf("POST ¹æ½ÄÀ» ÁöÁ¤Çؾ߸¸ ÇÕ´Ï´Ù.\n");
           exit(1);
         }
     /* TYPEÀº application/x-www-form-urlencoded À̾î¾ß ÇÔ */
     if (strcmp(getenv("CONTENT_TYPE"),
              "application/x-www-form-urlencoded")) {
  printf("Content-type: text/html\n\n");
  printf("<HTML>\n");
  printf("<BODY>\n");
  printf("<script language=\"javascript\">\n");
  printf("location.href=\"../index.html\"\n");
  printf("</script>\n");
  printf("</BODY>\n");
  printf("</HTML>\n");
//              printf("ÀÌ ÇÁ·Î±×·¥Àº FORMÀÇ °á°ú¸¦ ");
//              printf("Çؼ®Çϱâ À§Çؼ­¸¸ »ç¿ëµË´Ï´Ù.\n");
              exit(1);
         }
     /* ÀԷµǴ º¯¼ö¿Í °ªÀÇ ±æÀ̸¦ ¹Þ¾ÆµéÀÓ */
     cl=atoi(getenv("CONTENT_LENGTH"));

     /* stdinÀ¸·Î ÀԷµǴ ¹®ÀÚ¿­À» º¯¼ö¿Í °ªÀ¸·Î À߶󳻾î
         entries ±¸Á¶Ã¼¿¡ ÀúÀå */
      for(x=0; cl && (!feof(stdin)); x++) {
           m=x;
           entries[x].val=fmakeword(stdin, '&', &cl);
           entries[x].name=makeword(entries[x].val, '=');
      }
      nEntries=m+1;

     /* 16Áø¼ö·Î ÄÚµåÈ­µÈ ÇѱÛÀ» ¿ø»óÅ·Πº¹¿ø */
      for (x=0; x<nEntries; x++) {
            qURLdecode(entries[x].name);
            qURLdecode(entries[x].val);
       }
}

char *fmakeword(FILE *f, char stop, int *cl)
{
      int wsize=102400, ll=0;
      char *word=(char *) malloc(sizeof(char) * (wsize+1));
      /* º¯¼ö¿Í °ªÀÇ ½ÖÀ¸·Î Àü¼Û ¹®ÀÚ¿­À» Àß¶ó³¿ */
      while(1) {
           word[ll]=(char) fgetc(f);
           if(ll==wsize) {
              word[ll+1]='\0';
              wsize+=102400;
              word=(char *) realloc(word,sizeof(char)*(wsize+1));
           }
           --(*cl);
           if((word[ll]==stop) || (feof(f)) || (!(*cl))) {
               if(word[ll] != stop) ll++;
               word[ll]='\0';
               return word;
           }
           ++ll;
       }
}

char *makeword(char *line,  char stop)
{
    int x=0, y=0;
    char *word=(char *) malloc(sizeof(char) * (strlen(line)+1));
    for(x=0; ((line[x]) && (line[x] != stop)); x++)
    word[x]=line[x];
    word[x]='\0';
    if (line[x]) ++x;
    while(line[y++]=line[x++]);
    return word;
}

char *qURLdecode(char *str)
{
    int i, j;
    if(!str) return;
       for(i=j=0; str[j]; i++, j++)
            switch(str[j]){
               /* ´õÇϱâ(+) ±âÈ£¸¦ °ø¹é(' ')À¸·Î º¯È¯ */
               case '+': str[i]=' ';
                            break;
               /* '%'·Î ½ÃÀ۵Ǵ µÎ ¹®ÀÚ¸¦ ÇÑ±Û ÇѱÛÀÚ·Î º¯È¯ */
               case '%': str[i]=_x2c(str[j+1], str[j+2]);
                             j+=2;
                             break;
            }
       str[i]='\0';
       return str;
}

char _x2c(char hex_up, char hex_low)
{
   char digit;
   /* µÎ °³ÀÇ 16Áø¼ö °ªÀ» ÇϳªÀÇ 16Áø¼ö °ªÀ¸·Î º¯È¯ÇÑ´Ù */
   digit = 16 * (hex_up  >= 'A' ?
             ((hex_up  & 0xdf) - 'A') + 10 : (hex_up  - '0'));
   digit += (hex_low >= 'A' ?
             ((hex_low & 0xdf) - 'A') + 10 : (hex_low - '0'));
   return (digit);
}

void printout()
{
   FILE  *fp;
   char* id;
   char* password;

   id = malloc(10 * sizeof(char));
   password = malloc(10 * sizeof(char));

   file(&id, &password);
   /* Ãâ·ÂµÇ´Â ³»¿ëÀÌ ÅؽºÆ® ÇüÅÂÀÇ HTML ¹®ÀåÀÓÀ» ¾Ë·ÁÁÖ¸ç,
       ÀÌÈķδ printf()¹® ³»¿¡ HTML ¸í·ÉÀ» ±â¼úÇÑ´Ù */
   printf("Content-type: text/html\n\n");
   if(strcmp(id, entries[0].val)==0) //¾ÆÀ̵ð ¸í
   {
       if(strcmp(password, entries[1].val)==0) //ºñ¹Ð¹øÈ£
       {
         printf("<HTML>\n");
         printf("<HEAD>\n");
  printf("   <TITLE>Ȩ³×Æ®¿öÅ· </TITLE>\n");
         printf("</HEAD>\n");
  printf("<body bgcolor=white text=black link=blue vlink=purple alink=red>\n");
  printf("<table border=\"1\" bordercolor=\"white\">\n");
  printf("<tr>\n");
  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-1.cgi\" method=\"post\">\n");
    printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/temperature.gif\" name=\"temperature\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-2.cgi\" method=\"post\">\n");
   printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/humidity.gif\" name=\"humidity\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-3.cgi\" method=\"post\">\n");
  printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/lux.gif\" name=\"lux\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-4.cgi\" method=\"post\">\n");
   printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/consent.gif\" name=\"consent\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-5.cgi\" method=\"post\">\n");
   printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/lamp.gif\" name=\"lamp\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-6.cgi\" method=\"post\">\n");
  printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª

  printf("<input type=\"image\" src=\"../images/gas_valve.gif\" name=\"gas_valve\">\n");
  printf("</form>\n");
  printf("</td>\n");  

  printf("<td width=\"155\">\n");
  printf("<form action=\"./1-7.cgi\" method=\"post\">\n");
  printf("<input type=\"hidden\" name=\"id\" value=\"%s\">\n", entries[0].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"hidden\" name=\"pass\" value=\"%s\">\n", entries[1].val); //´Ù¸¥ÆäÀÌÁö·Î ³Ñ±æ ¾ÆÀ̵ð ºñ¹Ð¹øÈ£°ª
  printf("<input type=\"image\" src=\"../images/code_number.gif\" name=\"code_number\">\n");
  printf("</form>\n");
  printf("</td>\n");  
  printf("</tr>\n");  
  printf("</table>\n");  

  printf("</body>\n");
  printf("</html>\n");

       }
       else if(strcmp(password, entries[1].val)!=0) //ºñ¹Ð¹øÈ£
       {
  printf("<HTML>\n");
  printf("<BODY>\n");
  printf("<script language=\"javascript\">\n");
  printf("location.href=\"../index.html\"\n");
  printf("</script>\n");
  printf("</BODY>\n");
  printf("</HTML>\n");
       }
   }
   else if(strcmp(id, entries[0].val)!=0) //¾ÆÀ̵ð ¸í
   {
  printf("<HTML>\n");
  printf("<BODY>\n");
  printf("<script language=\"javascript\">\n");
  printf("location.href=\"../index.html\"\n");
  printf("</script>\n");
  printf("</BODY>\n");
  printf("</HTML>\n");
   }
  
   free(password);
   free(id);
}

void file(char** id, char** password)
{
 FILE *input;
 
 input = fopen("../¾ÆÀ̵ð¹×ºñ¹Ð¹øÈ£.txt", "rt");//ÆÄÀÏÀбâ

 fscanf(input, "%s", *id);
 fscanf(input, "%s", *password);
 
 fclose(input);
}

 

 

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û ·Î±×ÀÎÇÑ ¾ÆÀ̵ð Æнº¿öµå °ªÀ» °¡Áö°í ´Ù¸¥ÆäÀÌÁö ´Ù¸¥ÆäÀÌÁö·Î °ª°¡Áö°í °¡°Ô ¾î¶»ÄÉ Çϳª¿© 2007-05-20 21:42:42
´ÙÀ½°Ô½Ã±Û À̹ÌÁö ½½¶óÀ̵å ÀÛµ¿ÀÌ Á¦´ë·Î ¾ÈµË´Ï´Ù. 2007-05-28 11:22:17