´ÙÀ½ ÀÌÀü Â÷·Ê

12. »çÀÌÆ® ¸ÞÀÎ ÆäÀÌÁö ¸¸µé±â

»çÀÌÆ®ÀÇ ¸ÞÀÎ È­¸éÀº ÇÊÀÚÀÇ ÀÓÀÇ·Î ¸¸µé¾î ºÃ½À´Ï´Ù.    ¸ÕÀú ¸ÞÀÎ È­¸éÀÇ °æ¿ì ±× »çÀÌÆ®ÀÇ ¾ó±¼À̸ç Á¦°øÇÏ´Â ¸ðµç Á¤º¸¸¦ ÇÑ´«º¼ ¼ö ÀÖ¾î¾ß ÇÕ´Ï´Ù.    ±×¸®°í ȸ¿øÁ¦ »çÀÌÆ®ÀÏ °æ¿ì ·Î±×Àΰú ·Î±×¾Æ¿ô ±â´ÉÀÌ Á¸ÀçÇØ¾ß ÇÕ´Ï´Ù. ±× °úÁ¤À» Çϳª¾¿ »ìÆ캸°Ú½À´Ï´Ù.

12.1 ȸ¿ø Å×ÀÌºí ¸¸µé±â

±×·³ ¿©±â¼­ ¿ì¸®°¡ ¸¸µé »çÀÌÆ®ÀÇ ¸ÞÀÎ È­¸éÀ» ¸ÕÀú »ìÆ캸°Ú½À´Ï´Ù.

±×¸². 12-1 ¸ÞÀÎ È­¸é
ȸ¿øÁ¦ »çÀÌÆ®ÀÇ °æ¿ì °¢ ȸ¿øÀÇ ·Î±×ÀÎ ¸Þ´º¿Í ȸ¿øÀÌ ¾Æ´Ò °æ¿ì °¡ÀÔÇÏ´Â ºÎºÐÀÌ Á¸ÀçÇÕ´Ï´Ù.
ÀÌ ºÎºÐÀ» ±¸ÇöÇϱâ À§Çؼ­´Â °¢ ȸ¿øÀÇ Á¤º¸¸¦ ÀúÀåÇÒ °ø°£ÀÌ ÇÊ¿äÇÕ´Ï´Ù.
¿ì¼± ±âÁ¸¿¡ ¸¸µé¾îÁø µ¥ÀÌÅͺ£À̽º¿¡ ȸ¿øÀÇ Å×À̺íÀ» »ý¼ºÇصµ µÇÁö¸¸ ¿©±â¼­´Â »õ·Î¿î µ¥ÀÌÅͺ£À̽º¸¦
¸¸µé°í °Å±â¿¡ ȸ¿øµéÀÇ Á¤º¸¸¦ ´ãÀ» Å×À̺íÀ» »ý¼ºÇÏ°Ú½À´Ï´Ù.

µ¥ÀÌÅͺ£À̽º ¸¸µé±â

mysql>create databases selectuser ;

Å×À̺íÀ» »ý¼ºÇÒ µ¥ÀÌÅͺ£À̽º¸¦ ¸¸µé¾î ÁÝ´Ï´Ù.
¿©±â »ç¿ëÇÒ µ¥ÀÌÅͺ£À̽º ¸íÀº selectuserÀÌ°í ¿©·¯ºÐÀÌ ¼öÁ¤Çؼ­ »ç¿ëÇصµ µË´Ï´Ù.

Å×ÀÌºí ¸¸µé±â

./mysql -u root -p userin < userin.sql 

CD¿¡ ÀÖ´Â userin.sql ÆÄÀÏÀ» ÀÌ¿ëÇؼ­ userin Å×À̺íÀ» ÇÑ ¹ø¿¡ ¼³Ä¡ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
¸¸¾à »õ·Î¿î ÇʵåÀÇ Ãß°¡³ª ¼Ó¼ºÀ» º¯°æÇÒ °æ¿ì mysql ºÎºÐÀ» Âü°íÇϼ¼¿ä.
ÀÏÀÏÀÌ insert ¹®À» ÀÌ¿ëÇؼ­ ÀÔ·ÂÇÏ´Â ¹æ¹ýµµ ÀÖÁö¸¸ userin.sql ÆÄÀÏÀ» ¼öÁ¤Çؼ­ »ç¿ëÇÏ¸é ´õ ÆíÇÕ´Ï´Ù.

±×¸². 12-2 userin.sql

Å×À̺íÀÇ ÀÎÀÚµé

ȸ¿ø Å×À̺í(userin)À» ¸¸¾à »õ·Ó°Ô ¸¸µç ´Ù¸é ¿©·¯ºÐµéÀº Å×ÀÌºí¿¡ »ç¿ëÇÒ °¢ ÀÎÀڵ鿡 ´ëÇÑ »çÀüÀÇ °èȹÀÌ
ÀÖ¾î¾ß ÇÕ´Ï´Ù.   ȸ¿øµéÀÇ Á¤º¸ Áß ¾î´À ºÎºÐÀ» ÀúÀå ÇÒ °ÍÀÎÁö ¸íÈ®È÷ °áÁ¤ÇÑ ÈÄ ÀÛ¾÷À» ÇØ¾ß ÇÕ´Ï´Ù.
¿©±â¿¡ »ç¿ëÇÑ ºÎºÐµéÀº ±âº»ÀûÀÎ ºÎºÐÀÌ¸ç ¿©·¯ °¡Áö »õ·Î¿î ÀÎÀÚµéÀ» »ç¿ëÇØ ¸¸µé¾î º¸±â ¹Ù¶ø´Ï´Ù.
        
    name - ȸ¿ø À̸§ 
    id - ȸ¿ø °íÀ¯ ¾ÆÀ̵ð
    passwd - ȸ¿ø ¾ÏÈ£
    resident - ȸ¿ø ÁֹΠ¹øÈ£
    email - ȸ¿ø ¸ÞÀÏ ÁÖ¼Ò
    homepage - ȸ¿ø ȨÆäÀÌÁö ÁÖ¼Ò
    address - ȸ¿ø ÁÖ¼Ò
    wdate - ȸ¿ø °¡ÀÔÀÏ
    uno - ȸ¿ø ¿ìÆí¹øÈ£
    tel1 - ȸ¿ø ÈÞ´ëÆù ¹øÈ£
    tel2 - ȸ¿ø Áý ÀüÈ­¹øÈ£

12.2 ¼Ò½º ¸¸µé±â

¸ÞÀÎ È­¸éÀÇ ¼Ò½º´Â ÃÑ µÎ°³ÀÇ ÆÄÀÏ·Î ±¸¼º µË´Ï´Ù.    È­¸éÀ» Ãâ·ÂÇÏ´Â ÆÄÀÏ(userin.php)°ú °¢ È­¸éµéÀ» ÇÔ¼ö ÇüÅ·ΠÀúÀåÇÑ ÆÄÀÏ(userin_func.php)ÀÔ´Ï´Ù.    ÇϳªÀÇ ÆÄÀÏ·Î ¸¸µé¾î »ç¿ëÇÒ ¼öµµ ÀÖÀ¸¸ç °¢ ºÎºÐº°·Î °¢°¢ÀÇ ÆÄÀÏ·Î ¸¸µé ¼öµµ ÀÖ½À´Ï´Ù.

userin_func.php Àüü ÄÚµå

    <?php

    $connect = mysql_connect('localhost','root','gksmf444');
    mysql_select_db('selectuser',$connect);
    /*----------  mysql Á¢¼Ó ----------------*/


    function main_userin($sel) {
        echo("
        <html>
        <title>userin_view html</title>
        <body bgcolor=black>
        <center>
        <img src=skyt1.jpg border=0><br>

        <form method=post action=userin.php>

        <input type=hidden name=chanl value=checkid>

        <table border=0 cellspacing=2 cellpadding=2 width=700 >
                                                                                                                                                                                                        
        <font style='font-size:13px;font-style:italic;color:#fffff0>
        (*´Â Çʼö ÀÔ·Â ºÎºÐÀÔ´Ï´Ù.)</font>
                                                                                                                                                                                                                                                        
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=submit value=IDÁߺ¹È®ÀÎ></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=id size=9 maxlength=8>(* 4~8ÀÚÀÇ ¿µ¼ýÀÚ Á¶ÇÕ)</font></td>
        </tr>
        </form>

        <form method=post action=userin.php>

        <input type=hidden name=chanl value=in>
        <input type=hidden name=sel value=$sel>

        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~ID</b></fontZ></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=id size=9 maxlength=8>(* 4~8ÀÚÀÇ ¿µ¼ýÀÚ Á¶ÇÕ)</font>*lt;/td>
        </tr>
                
        <tr>
          <td width=90 bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Name</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=name size=9>(* ÇÑ±Û À̸§)</font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Passwd</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=password name=passwda size=9 maxlength=8>
          (* ¿µ¼ýÀÚ Á¶ÇÕ 4~8)</font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~PasswdRE</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=password name=passwdb size=9 maxlength=8>*</font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Email</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=emaila size=8>@
          <input type=text name=emailb size=15>(* sss@sss.sss.ss)
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~HomePG</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>HTTP://
          <input type=text name=home size=20>
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Resident</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=rsda size=7>-
          <input type=text name=rsdb size=8>(* 1111-11111)
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Tel1</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <select name=tela>
            <option value=017 selected>017
            <option value=018>018
            <option value=019>019
            <option value=011>011
            <option value=016>016
          </select>-
          <input type=text name=telb size=5>-
          <input type=text name=telc size=5>(* ÈÞ´ëÆù ¹øÈ£)
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Tel2</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=tel2a size=4>-
          <input type=text name=tel2a size=4>-
          <input type=text name=tel2b size=5>-
          <input type=text name=tel2c size=5>
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~¿ìÆí¹øÈ£</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=uno size=4>-
          <input type=text name=uno2 size=4>*
          </font></td>
        </tr>
                
        <tr>
          <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0>
          <b>~Address</b></font></td>
          <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=text name=address size=54>* </font></td>
        </tr>
                
        <tr>
          <td bgcolor=black align=center colspan=4>
          <font style='font-size:13px;font-style:italic;color:#fffff0>
          <input type=submit value=ȸ¿øµî·Ï>
          <input type=reset  value=´Ù½Ã></font></td>
          </tr>

        </table>          
        </form>           
        </center>
                
        </body>
        </html>
        ");
    }


    function error_user($connect,$id,$name,$passwda,$passwdb,$emaila,$emailb,$rsda,$rsdb,$telb,$telc,$uno,$uno2,$address)
    {

      $ally = mysql_query("select id from userin where id='$id' ",$connect);
      $userin = mysql_fetch_array($ally);


      if(!$id)
      {
        echo("
        <script>
          window.alert('id°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if($userin[id])
      {
        echo("
        <script>
          window.alert('°°Àº id°¡ ÀÖ½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!ereg("[0-9a-zA-z]",$id) || strlen($id) < 4)
      {
        echo("
        <script>
          window.alert('id´Â ¿µ¹®¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      for($n = 0 ; $n < strlen($name) ; $n++)
      {

        if(ord($name[$n]) <= 0x80)
        {
          echo("
          <script>
            window.alert('À̸§ÀÌ ¾ø°Å³ª ÇѱÛÀÌ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
            history.go(-1)
          </script>
          ");

          exit;
        }
      }


      if(!$name)
      {
        echo("
        <script>
          window.alert('À̸§ÀÌ ¾ø½À´Ï´Ù. À̸§ºÎÅÍ ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!$passwda || !$passwdb || $passwda != $passwdb)
      {
        echo("
        <script>
          window.alert('passw°¡ ¾ø°Å³ª Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!ereg("[0-9a-zA_Z]",$passwda) || strlen($passwda) < 4)
      {
        echo("
        <script>
          window.alert('passw´Â ¿µ¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");
                                                                                                                                                                                                                                                            exit;
      }


      if(!$emaila || !$emailb)
      {
        echo("
        <script>
          window.alert('¸ÞÀÏ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!ereg("[0-9a-zA_Z]",$emaila) || !ereg("[0-1a-zA_Z]",$emailb))
      {
        echo("
        <script>
          window.alert('emailÀº ¿µ¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      $rsdno = "234567892345";
      $rsdin = $rsda.$rsdb ;
      $rsdchecka = substr($rsdin,$n,1);
      $rsdcheckb = substr($rsdno,$n,1);


      for ($n = 0 ; $n < 12 ; $n++)
      {
        $rsdall = $rsdall + $rsdchecka*$rsdcheckb ;
      }


      $rsdcheck = "11" - "($rsdall % 11)";
      $rsdb2 = substr($rsdb,0,1);
      $rsdcheck2 = substr($rsdcheck,-1,1);
      $rsdcheck3 = substr($rsdb,-1,1);
      $rsdcheck4 = ereg("[1-4]",$rsdb2);


      if(!$rsdcheck4 || $rsdcheck2 != $rsdcheck3)
      {
        echo("
        $rsdcheck2
        $rsdcheck3

        <script>
          window.alert('ÁֹιøÈ£111°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!$rsda || !$rsdb)
      {
        echo("
        <script>
          window.alert('ÁֹιøÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!$telb || !$telc)
      {
        echo("
        <script>
          window.alert('ÀüÈ­¹øÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>

        exit;
      }


      if(!$uno || !$uno2)
      {
        echo("
        <script>
          window.alert('¿ìÆí¹øÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }


      if(!$address)
      {
        echo("
        <script>
          window.alert('ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
          history.go(-1)
        </script>
        ");

        exit;
      }
    }


    function main_view($username,$connect)

    {

      mysql_select_db(adminp,$connect);


      $ally = mysql_query("select no,title,mview,view from admin  order by no ",$connect);
      $ally2 = mysql_query("select no,title,mview,view from file  order by no ",$connect);

         
      $put = mysql_fetch_array($ally);
      $put2 = mysql_fetch_array($ally2);


      mysql_select_db('libchal',$connect);
                  

      $allya = mysql_query("select no,title,hit from $put[mview]  order by hit desc",$connect);
      $allyb = mysql_query("select no,title,hit from $put2[mview] order by hit desc",$connect );
      $put3 = mysql_fetch_array($allya);
      $put4 = mysql_fetch_array($allyb);


      $t_num=mysql_num_rows($ally);
      $t_num2=mysql_num_rows($ally2);
      $wdate = date('H:i:s');


      if($username) {
        $sslogin = "$username login Çß½À´Ï´Ù.";
        $chat_mod ="<a href ='userin.php?chanl=chat&username=$username' >";
      }


      if(!$username) {
        $sslogin = "Login Çϼ¼¿ä~!";
        $userss = "<a href ='userin.php?chanl=main'>";     
      }



      if($username == guest)
      {
        $sslogin = "$username login Çß½À´Ï´Ù.";
        $userss = "<a href ='userin.php?chanl=main'>";
      }


      echo("
      <html>
      <title>
      main_view html
      </title>
      <body bgcolor=black>
      <center>
      <img src=skyt1.jpg border=0>
      </br>
      <font style='font-size:12px;color:gray'>
      $sslogin
      </font>
      <br>
      <br>


      <table border=0 cellspacing=2 cellpadding=2 width=500 >
      <tr>
      <font style='font-size:12px;color:gray'>
      $userss
      (ȸ¿ø °¡ÀÔ)
      </a>
      (geustÀÔÀåÀº id¿¡ guestÀÔ·Â)
      $chat_mod
      (Chating)
      </a>
      </font>
      <form method=post action=userin.php>
      <input type=hidden name=chanl value=login>
      <td width=90 bgcolor=#808080 align=center>
      <font style='font-size:13px;font-style:italic;color:#fffff0'>
      <b>~ID</b></font></td>
      <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
      <input type=text name=id size=9></font></td>
      <td width=50 bgcolor=black>
      <img src=icon.jpg border=0 align=center>
      </td>
      <td bgcolor=black  align=left>
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
      <a href ='m.php?chanl=main_view&f=$put2[mview]&f2=$put2[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
      $put2[title]</font></a>
      </td>
      </tr>


      <tr>
      <td width=90 bgcolor=#808080>
      <font style='font-size:13px;font-style:italic;color:#fffff0'>
      <b>~Passwd</b></font></td>
      <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
      <input type=password name=passwd size=9></font></td>


      <td width=50 bgcolor=black align=left>
      <img src=icon.jpg border=0 align=center>
      </td>


      <td bgcolor=black  align=left>
      <a href='main_view.php?chanl=main_view&f=$put[mview]
      &f2=$put[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
      $put[title]</font></a></td>
      </tr>


      <tr>
      <td width=90 bgcolor=black>
      <input type=submit value=Login>
      </form>
      </td>
      <form method=post action=userin.php>
      <input type=hidden name=chanl value=logout>
      <td bgcolor=black>
      <input type=submit value=Logout>
      </form>
      </td>


      <td width=50 bgcolor=black>
      <img src=icon.jpg border=0 align=center>
      </td>


      <td bgcolor=black  align=left>
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
      <form method=post action=shop.php>cry~
          <select name=sel>
          <option value=1 selected>ÀüÀÚÁ¦Ç°
          <option value=2>ÀÇ·ù
          <option value=3>À½¾Ç
          <option value=4>Ã¥
          </select>!shop</font>
      <input type=submit value=~Go>
      </td>
      </form>
      </tr>
      </table>
      ");


      echo("
      <br>
      <table border=0 cellspacing=2 cellpadding=2 width=700 >


      <td bgcolor=black  align=center width=200>
      <font style='font-size:13px;font-style:italic;color:white'>
      <img src=icon.jpg border=0 align=center>Top ÀÚ·á</font></td>


      <td bgcolor=black  align=left width=500>
      <a href ='m.php?chanl=title&no=$put4[no]&f=$put2[mview]
      &f2=$put2[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
      <strong>$put4[title]</strong></font></a></td>


      <tr>
      <td bgcolor=black  align=center width=200>
      <font style='font-size:13px;font-style:italic;color:white'>
      <img src=icon.jpg border=0 align=center>Top °æ¸Å</font></td>


      <td bgcolor=black  align=left width=500>
      <a href ='main_view.php?chanl=title&no=$put3[no]&f=$put[mview]
      &f2=$put[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
      <strong>$put3[title]</strong></font></a></td>
      </tr>
      </table>");


      echo("
      <table border=0 cellspacing=2 cellpadding=2 width=300 >
      <tr>
      <td colspan=2 bgcolor=#808080 align=center>
      <font style='font-size:13px;font-style:italic;color:#fffff0'>
      <b>~File bang list</b></font></td>
      </tr>
      ");


      for($pd=1 ; $pd < $t_num2 ; $pd++)
      
          {
      
          $put2 = mysql_fetch_array($ally2);
      echo("
      <tr>
      <td bgcolor=black align=center width=200>
      <img src=icon.jpg border=0 align=center></td>
      <td bgcolor=black  align=left width=500>
      <a href ='m.php?chanl=main_view&f=$put2[mview]&f2=$put2[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
      <strong>$put2[title]</strong></font></a></td>
      </tr>
      ");
      
      }


      echo("
      <table border=0 cellspacing=2 cellpadding=2 width=300 >


      <tr>
      <td colspan=2 bgcolor=#808080 align=center>
      <font style='font-size:13px;font-style:italic;color:#fffff0'>
      <b>~°æ¸Å bang list</b></font></td>
      </tr>
      ");


      for($pd=1 ; $pd < $t_num ; $pd++)
          
      {
          
      $put = mysql_fetch_array($ally);


      echo("
      <tr>
      <td bgcolor=black align=center width=200>
      <img src=icon.jpg border=0 align=center></td>
      <td bgcolor=black  align=left width=500>
      <a href ='main_view.php?chanl=main_view&f=$put[mview]
      &f2=$put[view]&ssid=$username' >
      <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
      <strong>$put[title]</strong></font></a></td>
      </tr>
      ");

      }


      echo("
      </table>
      </center>
      </body>
      <html>
      ");

      }

    ?>

¼Ò½º ¼³¸í

    ¸ÞÀÎ È­¸éÀÇ °¢ ºÎºÐµéÀ» ±¸¼ºÇÏ´Â È­¸éÀ» ÇÔ¼ö ÇüÅ·ΠÀúÀåÇÑ ÆÄÀÏÀÔ´Ï´Ù.

    userin_func.php ÆÄÀÏ ³»ÀÇ ÇÔ¼ö´Â ¸ÞÀÎ È­¸éÀÇ ¶Ç ´Ù¸¥ ±â´ÉÀ» Ãß°¡ÇÒ °æ¿ì ÇÔ¼ö¸¸ Ãß°¡Çؼ­ »ç¿ëÇÏ¸é µË´Ï´Ù.

Database Á¢¼Ó ¸¸µé±â

    $connect = mysql_connect('localhost','root','gksmf444');

    /* MysqlÀ» Á¢¼ÓÇϱâ À§ÇÑ È£½ºÆ® ¸í°ú ¾ÆÀ̵ð, Æнº¿öµå¸¦ ÀÔ·Â ÇÕ´Ï´Ù. 
        
       ¿©±â¿¡ »ç¿ëÇÑ È£½ºÆ®¿Í ¾ÆÀ̵ð, Æнº¿öµå´Â ¿©·¯ºÐµéÀÌ »õ·Î ¸¸µé¾ú´Ù¸é ±×°ÍÀ» Àû¾îÁÖ¸é µË´Ï´Ù. */


    mysql_select_db('selectuser',$connect);

    /* MysqlÀÇ µ¥ÀÌÅͺ£À̽º¸¦ ¼±ÅÃÇÕ´Ï´Ù. */

main_userin($sel) ÇÔ¼ö

    óÀ½ ¸ÞÀÎ È­¸é¿¡ Á¢¼ÓÇÏ°í ȸ¿ø °¡ÀÔÀ» Ŭ¸¯ÇßÀ» °æ¿ì Ãâ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù.

±×¸². 12-3 ȸ¿ø °¡ÀÔ È­¸é

ID Áߺ¹ È®ÀÎ ¸¸µé±â

    <form method=post action=userin.php>
    /* ÀÌ form¹®À» ÀÌ¿ëÇؼ­ ÀÔ·ÂµÈ °ªÀ» userin.php ÆÄÀÏ·Î Àü¼ÛÇÕ´Ï´Ù. */

    <input type=hidden name=chanl value=checkid>
    /* userin.php ÆÄÀÏÀÇ $chanl=checked Ç׸ñÀ» ¼±ÅÃÇÕ´Ï´Ù. */

    <table border=0 cellspacing=2 cellpadding=2 width=700 >
    <font style='font-size:13px;font-style:italic;color:#fffff0'>
    (*´Â Çʼö ÀÔ·Â ºÎºÐÀÔ´Ï´Ù.)</font>
    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=submit value=IDÁߺ¹È®ÀÎ></font></td>
    /* ÀÔ·ÂÇÑ ID¸¦ Àü¼Û Çϱâ À§ÇÑ ¹öÆ°(submit)À» ¸¸µì´Ï´Ù. */

    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=id size=9 maxlength=8>(* 4~8ÀÚÀÇ ¿µ¼ýÀÚ Á¶ÇÕ)</font></td>
    /* IDÀÇ ÀÔ·ÂÀº ÃÖ´ë 8ÀÚ¸¸ °¡´ÉÇÏ°Ô ÇÕ´Ï´Ù. */

    </tr>
    </form>

½Å±Ô ȸ¿ø ID ÀԷ¶õ ¸¸µé±â

    <form method=post action=userin.php>
    <input type=hidden name=chanl value=in>
    <input type=hidden name=sel value=$sel>
    /* ÀÌ form ¹®Àº À§ IDÁߺ¹ È®ÀÎ ¹® ÀÌÈÄÀÇ ¸ðµç ÀÔ·ÂÀ» Àü´ÞÇÏ´Â ºÎºÐÀÌ°í, userin.php ÆÄÀÏÀÇ $chanl=in Ç׸ñ°ú
        
       $selÀÇ ÇØ´çÇ׸ñ(chanl=in)ÀÇ ¼öÇà ÈÄ µÇµ¹¾Æ°¥ È­¸éÀ» ¼±ÅÃÇÏ´Â ºÎºÐÀÔ´Ï´Ù. Áï, ¸ÞÀÎ È­¸éÀ» ÅëÇØ È¸¿ø °¡ÀÔ
           
       È­¸é¿¡ ¿ÔÀ» °æ¿ì $sel °ªÀº ¾Æ¹°Íµµ ¾ø½À´Ï´Ù. ±×·² °æ¿ì ȸ¿ø °¡ÀÔ ¼öÇà ÈÄ ´Ù½Ã ¸ÞÀÎ È­¸éÀ¸·Î µ¹¾Æ¿É´Ï´Ù. */

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~ID</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=id size=9 maxlength=8>(* 4~8ÀÚÀÇ ¿µ¼ýÀÚ Á¶ÇÕ)</font></td>
    /* »ç¿ëÇÒ ID¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù. ÃÖ´ë ÀÔ·Â ±ÛÀº 8ÀÚ·Î Á¦ÇÑÇÕ´Ï´Ù. */
    </tr>

ȸ¿ø À̸§ ÀԷ¶õ ¸¸µé±â

    <tr>
    <td width=90 bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Name</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=name size=9>(* ÇÑ±Û À̸§)</font></td>
    /* À̸§ÀÇ ÀÔ·Â °ªÀº name º¯¼ö·Î ȸ¿ø À̸§À» ÀÔ·Â ¹Þ½À´Ï´Ù. */
    </tr>

ȸ¿ø Æнº¿öµå ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Passwd</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=password name=passwda size=9 maxlength=8>
    (* ¿µ¼ýÀÚ Á¶ÇÕ 4~8)</font></td>
    </tr>

    /* ȸ¿øÀÇ ID¿¡ »ç¿ëÇÒ Æнº¿öµå¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù. ÃÖ´ë Å©±â´Â 8·Î ÇÕ´Ï´Ù. Input type´Â password·Î ¼³Á¤ÇÕ´Ï´Ù. 

       ÀÌ°ÍÀº È­¸é¿¡ *****°Ô Ç¥½ÃÇØ ´Ù¸¥ »ç¶÷ÀÌ º¸Áö ¸øÇÏ°Ô ÇÏ´Â °ÍÀÔ´Ï´Ù. */


    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~PasswdRE</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=password name=passwdb size=9 maxlength=8>*</font></td>
    </tr>

    /* »ç¿ëÇÒ Æнº¿öµåÀÇ ÀçÈ®ÀÎ ÀԷ¶õÀ» ¸¸µì´Ï´Ù. ÃÖ´ë ÀÔ·Â Å©±â´Â 8ÀÔ´Ï´Ù.
        
       ÀÌ Ç׸ñ ¿ª½Ã type=password·Î ¼³Á¤Çϸçç Àü´Þ ¹Þ´Â ÀÎÀÚ´Â passwdbÀÔ´Ï´Ù. */

¸ÞÀÏ°ú ȨÆäÀÌÁö ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Email</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=emaila size=8>@
    <input type=text name=emailb size=15>(* sss@sss.sss.ss)
    /* @¸¦ Áß½ÉÀ¸·Î µÎ°³ÀÇ ÀԷ¶õÀ» »ý¼ºÇÏ°í Â÷·Ê·Î emaila, emailb º¯¼ö·Î ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀԷ¹޽À´Ï´Ù. */
    </font></td>
    </tr>


    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~HomePG</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    HTTP://
    <input type=text name=home size=20>
    /* HTTP:// Ç׸ñÀ» Ãâ·ÂÇÏ°í home ÀÎÀÚ·Î »ç¿ëÀÚ È¨ÆäÀÌÁö ÁÖ¼Ò¸¦ ÀÔ·Â ¹Þ½À´Ï´Ù. */


    </font></td>
    </tr>

ÁֹιøÈ£ ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Resident</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=rsda size=7>-
    <input type=text name=rsdb size=8>(* 1111-11111)
    /* - ±âÈ£¸¦ Áß½ÉÀ¸·Î µÎ°³ÀÇ º¯¼ö(rsda , rsdb)·Î »ç¿ëÀÚ ÁֹΠ¹øÈ£¸¦ ÀÔ·ÂÇÕ´Ï´Ù. */


    </font></td>
    </tr>

ÈÞ´ëÆù ¹øÈ£ ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Tel1</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <select name=tela>
    <option value=017 selected>017
    <option value=018>018
    <option value=019>019
    <option value=011>011
    <option value=016>016
    </select>-
    /* select ¹®À» »ç¿ëÇؼ­ ÇöÀç ¼­ºñ½º ÁßÀÎ ÈÞ´ëÆù ȸ»ç¸¦ ¼±ÅÃÇÏ°Ô ÇÕ´Ï´Ù. tela º¯¼ö¿¡ ÀúÀå µË´Ï´Ù. */
    <input type=text name=telb size=5>-
    <input type=text name=telc size=5>(* ÈÞ´ëÆù ¹øÈ£)
    /* °¢°¢ ÈÞ´ëÆù ¸¶Áö¸· ¹øÈ£¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù. Àü´Þ ÀÎÀÚ´Â Â÷·Ê·Î telb , telcÀÔ´Ï´Ù. */


    </font></td>
    </tr>

ÀÚÅà ÀüÈ­¹øÈ£ ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Tel2</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=tel2a size=4>-
    <input type=text name=tel2b size=5>-
    <input type=text name=tel2c size=5>
    </font></td>
    </tr>
    /* Áö¿ª ¹øÈ£¸¦ Æ÷ÇÔÇÑ 3°³ÀÇ º¯¼ö·Î ÀúÀåÇÕ´Ï´Ù. °¢°¢ tel2a , tel2b , tel2c ÀÔ´Ï´Ù. */

¿ìÆí ¹øÈ£¿Í ÀÚÅà ÀüÈ­¹øÈ£ ÀԷ¶õ ¸¸µé±â

    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~¿ìÆí¹øÈ£</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=uno size=4>-
    <input type=text name=uno2 size=4>*
    </font></td>
    </tr>
    /* ¿ìÆí ¹øÈ£¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù. µÎ°³ÀÇ ÀԷ¶õÀ» -·Î ±¸ºÐÇÏ¸ç °¢°¢ uno , uno2 º¯¼ö·Î ÀÔ·Â ¹øÈ£¸¦ Àü´ÞÇÕÏ´Ù. */


    <tr>
    <td bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Address</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=address size=54>* </font></td>
    /* ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù. ÁÖ¼Ò ÀÔ·ÂÀº º¸´Ù »ç¿ëÀÚ Áß½ÉÀÇ ÀÔ·Â ÇüÅ·Π¸¸µé ¼ö ÀÖ½À´Ï´Ù.
        
       Áï ÇØ´ç µµ½Ã¿Í Çش絿 µîÀÇ ÀÔ·ÂÀ» ÀÚµ¿À¸·Î ã°Ô ÇÏ´Â ¹æ¹ýÀε¥, ÀÌ°ÍÀº Àü±¹ÀÇ ÁÖ¼Ò¿Í ¿ìÆí¹øÈ£¸¦ °¡Áø
           
       µ¥ÀÌÅͺ£À̽º ÆÄÀÏÀÌ ÀÖ¾î¾ß Çϸç ÀÎÅÍ³Ý »ó¿¡¼­ ½±°Ô ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù.
           
       ¿©±â¼­´Â ȸ¿øÀÇ ÀÓÀÇ·Î ÀûÀ» ¼ö ÀÖµµ·Ï Çß½À´Ï´Ù. ¸¸¾à ȸ¿øÀÌ ¼îÇÎÀ» ÇÏ°í ¹°°ÇÀ» ±¸¸ÅÇÑ´Ù¸é ÀÌ ÁÖ¼Ò¶õÀ» 
           
       Á¤È®È÷ ÀÔ·Â Çؾ߸¸ ¹è´ÞÀÌ µÉ °ÍÀÔ´Ï´Ù. */
    </tr>

ÀÔ·Â Ç׸ñ Àü´Þ ¹öÆ° ¸¸µé±â

    <tr>
    <td bgcolor=black align=center colspan=4>
    <font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=submit value=ȸ¿øµî·Ï>
    /* ȸ¿øµî·Ï ¹öÆ°À» »ý¼ºÇÕ´Ï´Ù. ÀÌ°ÍÀº À§ ÀÔ·Â Ç׸ñµéÀÇ °ªÀ» userin.php ÆÄÀÏ·Î Àü´ÞÇÕ´Ï´Ù. */
    <input type=reset  value=´Ù½Ã></font></td>
    /* ´Ù½Ã ¹öÆ°À» »ý¼ºÇÕ´Ï´Ù. type=resetÀ̸ç ÀÌ°ÍÀº ÀÔ·Â Ç׸ñÀ» ÀüºÎ ´Ù½Ã ÀÔ·ÂÇÒ ¶§ »ç¿ëÇÕ´Ï´Ù. */
    </tr>
    </table>
    </form>/* Áߺ¹ ID °Ë»ç form¹® ÀÌÈÄ µÎ ¹ø° form¹®ÀÇ ³¡ÀÔ´Ï´Ù. */
    </center>
    </body>
    </html>
    ");

error_user( ) ÇÔ¼ö Ç׸ñ

    ȸ¿ø °¡ÀÔ ÀԷ¶õÀÇ ÀÔ·Â Á¶°ÇÀ» ºÎ¿© ÇÕ´Ï´Ù.

    Áï, ȸ¿ø °¡ÀÔ Ç׸ñ Áß »ç¿ëÀÚ°¡ ºÎÁ¤È®ÇÏ°Ô ÀÔ·ÂÇÒ °æ¿ì ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÏ´Â ºÎºÐ ÀÔ´Ï´Ù.

±×¸². 12-4 ¿¡·¯ È­¸é ¿¹

ÇÔ¼ö Àü´Þ ÀÎÀÚµé

    error_user($connect,$id,$name,$passwda,$passwdb,$emaila,$emailb,$rsda,$rsdb,$telb,$telc,$uno,$uno2,$address)

    /* °¢ Àü´Þ ÀÎÀڴ ȸ¿ø ÀÔ·Â È­¸é¿¡¼­ ÀÔ·Â Çß´ø °ªÀ» Àü´Þ ÇÏ´Â º¯¼öµé ÀÔ´Ï´Ù. ±×¸®°í,

    $connectÀÇ °æ¿ì mysqlÀ» Á¢¼Ó ÇÏ´Â º¯¼ö ÀÔ´Ï´Ù. */ 

ID üũ

    if(!$id)
    {

      echo("
      <script>
      window.alert('id°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')
      history.go(-1)
      </script>
      ");

      exit;
    }
    /* $id °ªÀÌ ¾øÀ» °æ¿ì Ãâ·ÂÇÏ´Â È­¸é ÀÔ´Ï´Ù. */


    if($userin[id])
    {

      echo("
      <script>
      window.alert('°°Àº id°¡ ÀÖ½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
      history.go(-1)
      </script>
      ");

      exit;
    }
    /* $userin[id] °ªÀÌ Á¸ÀçÇÒ °æ¿ì °°Àº id°¡ ÀÖ´Â °ÍÀ̹ǷΠÇØ´ç È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */


    if(!ereg("[0-9a-zA-z]",$id) || strlen($id) < 4)
    { 

      echo("
      <script>
      window.alert('id´Â ¿µ¹®¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä')
      history.go(-1)
      </script>
      ");

      exit;
    }

    /* Àü´Þ µÇ¾î¿Â $id °ªÀÌ ¼ýÀÚ¿Í ¿µ¹® Áß 4ÀÚ º¸´Ù ÀÛÀ» °æ¿ì ¿¡·¯¸¦ Ãâ·Â ÇÕ´Ï´Ù.
        
       Áï,ereg ÇÔ¼ö¸¦ »ç¿ëÇؼ­ [0-9a-zA-z] ¼ýÀÚ¿Í ¿µ¹®´ë¼Ò¹®ÀÚ°¡ ¾Æ´Ï¸é ¿¡·¯¸¦ Ãâ·Â ÇÏ°í ¶Ç´Â strlen ÇÔ¼ö¸¦
           
       »ç¿ëÇؼ­ Àü´ÞµÇ¾î¿Â ÀÎÀÚ Áß ¹®ÀÚ¼ö°¡ 4º¸´Ù ÀÛÀ» æ¿ì ¿¡·¯¸¦ Ãâ·Â ÇÕ´Ï´Ù. */

ȸ¿ø À̸§ üũ

    for($n = 0 ; $n < strlen($name) ; $n++)
    {


    if(ord($name[$n]) <= 0x80)
    {

    echo("
    <script>
    window.alert('À̸§ÀÌ ¾ø°Å³ª ÇѱÛÀÌ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");
    exit;
    }
    }
    /* Àü´Þ µÇ¾î¿Â ȸ¿ø À̸§ÀÌ ÇѱÛÀÎÁö ¾Æ´ÑÁö üũ ÇÏ°í ¾Æ´Ò °æ¿ì ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */


    if(!$name)
    {

    echo("
    <script>
    window.alert('À̸§ÀÌ ¾ø½À´Ï´Ù. À̸§ºÎÅÍ ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ȸ¿ø À̸§ÀÌ ÀÔ·Â µÇÁö ¾Ê¾ÒÀ» °æ¿ì Ãâ·Â µÇ´Â È­¸é ÀÔ´Ï´Ù. */

Æнº¿öµå üũ

    if(!$passwda || !$passwdb || $passwda != $passwdb)
    {

    echo("
    <script>
    window.alert('passw°¡ ¾ø°Å³ª Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ȸ¿ø °¡ÀÔ Ç׸ñ Áß Æнº¿öµå ºÎºÐ°ú Æнº¿öµå È®ÀÎ ºÎºÐÀÇ ÀÎÀÚ°¡ ¾øÀ» °æ¿ì ¶Ç´Â µÑÀÌ °°Áö ¾ÊÀ» °æ¿ì
        
       ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */


    if(!ereg("[0-9a-zA_Z]",$passwda) || strlen($passwda) < 4)
    {
        
    echo("
    <script>
    window.alert('passw´Â ¿µ¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");
        
    exit;
    }
    /* Æнº¿öµå°¡ ¿µ¹® ´ë¼Ò¹®ÀÚ³ª ¼ýÀÚ°¡ ¾Æ´Ò °æ¿ì ¶Ç´Â Àü´Þ µÇ¾î¿Â ¹®ÀÚ°¡ 4ÀÚ º¸´Ù ÀÛÀ» °æ¿ì ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */

¸ÞÀÏ ÁÖ¼Ò Ã¼Å©

    if(!$emaila || !$emailb)
    {

    echo("
    <script>
    window.alert('¸ÞÀÏ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ¸ÞÀÏ ÁÖ¼Ò Ç׸ñÀÌ ¾øÀ» °æ¿ì Ãâ·Â ÇÏ´Â È­¸é ÀÔ´Ï´Ù. */


    if(!ereg("[0-9a-zA_Z]",$emaila) || !ereg("[0-1a-zA_Z]",$emailb))
    {

    echo("
    <script>
    window.alert('emailÀº ¿µ¼ýÀÚ Á¶ÇÕ À̾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* Àü´Þ µÇ¾î¿Â µÎ°³ÀÇ ¸ÞÀÏ ÁÖ¼Ò ÀÎÀÚ¿¡ ´ëÇØ ¿µ¹® ´ë¼Ò¹®ÀÚ ¿Í ¼ýÀÚ°¡ ¾Æ´Ï¸é ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */

ÁֹΠ¹øÈ£ üũ

    $rsdno = "234567892345";
    $rsdin = $rsda.$rsdb ;
    /* Àü´Þ µÇ¾î¿Â µÎ°³ÀÇ ÁֹΠ¹øÈ£ ÀÎÀÚ¸¦ Çϳª·Î ¸¸µì´Ï´Ù. */


    $rsdchecka = substr($rsdin,$n,1);
    /* Àü´Þ µÇ¾î¿Â ÁֹΠ¹øÈ£ ÀÎÀÚ ÀÔ´Ï´Ù. */


    $rsdcheckb = substr($rsdno,$n,1);


    for ($n = 0 ; $n < 12 ; $n++)
    {
      $rsdall = $rsdall + $rsdchecka*$rsdcheckb ;
    }


    $rsdcheck = "11" - "($rsdall % 11)";
    $rsdb2 = substr($rsdb,0,1);
    /* ÁֹΠ¹øÈ£ µÎ ¹ø° ÀÎÀÚÀÇ Ã³À½ ¼ýÀÚ¸¦ ÃßÃâ ÇÕ´Ï´Ù. */


    $rsdcheck2 = substr($rsdcheck,-1,1);
    /* ÁֹΠ¹øÈ£ÀÇ ¸¶Áö¸· ÀÚ¸® ¼ýÀÚ¸¦ ÃßÃâ ÇÕ´Ï´Ù. */


    $rsdcheck3 = substr($rsdb,-1,1);
    /* ÁֹΠ¹øÈ£ÀÇ ¸¶Áö¸· ÀÚ¸® ¼ýÀÚ¸¦ ÃßÃâ ÇÕ´Ï´Ù. */


    $rsdcheck4 = ereg("[1-4]",$rsdb2);
    /* ÁֹΠ¹øÈ£ µÎ ¹ø° ÀÎÀÚÀÇ Ã³À½ ¼ýÀÚ°¡ 1~4 Áß Çϳª ÀÎÁö üũ ÇÕ´Ï´Ù. */


    if(!$rsdcheck4 || $rsdcheck2 != $rsdcheck3)
    {

    echo("
    $rsdcheck2
    $rsdcheck3
    <script>
    window.alert('ÁֹιøÈ£111°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ÁֹΠ¹øÈ£ µÎ ¹ø° ÀÎÀÚ°¡ 1~4 Áß Çϳª°¡ ¾Æ´Ò °æ¿ì ¶Ç´Â µÎ ¹ø° ÀÎÀÚ ¸¶Áö¸· ¼ýÀÚ°¡

       ÀÏÄ¡ ÇÏÁö ¾ÊÀ» °æ¿ì ¿¡·¯¸¦ Ãâ·Â ÇÕ´Ï´Ù. */


    if(!$rsda || !$rsdb)
    {

    echo("
    <script>
    window.alert('ÁֹιøÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ÁֹΠ¹øÈ£ µÎ ÀÎÀÚ°¡ ¾øÀ» °æ¿ì ¿¡·¯¸¦ Ãâ·Â ÇÕ´Ï´Ù. */

ÈÞ´ëÆù ¹øÈ£¿Í ¿ìÆí ¹øÈ£ üũ

    if(!$telb || !$telc)
    {

    echo("
    <script>
    window.alert('ÀüÈ­¹øÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");
        
    exit;
    }
    /* ÈÞ´ëÆù ¹øÈ£ µÎ ÀÎÀÚ Áß Çϳª°¡ ¾øÀ» °æ¿ì ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */


    if(!$uno || !$uno2)
    {

    echo("
    <script>
    window.alert('¿ìÆí¹øÈ£°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;
    }
    /* ¿ìÆí ¹øÈ£ µÎ ÀÎÀÚ Áß Çϳª°¡ ¾øÀ» °æ¿ì ¿¡·¯ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */

ÁÖ¼Ò Ã¼Å©

    if(!$address)
    {

    echo("
    <script>
    window.alert('ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
    history.go(-1)
    </script>
    ");

    exit;                  
    }
    /* ÁÖ¼Ò°¡ ¾øÀ» °æ¿ì Ãâ·Â ÇÏ´Â È­¸é ÀÔ´Ï´Ù. */

main_view( ) ÇÔ¼ö

    »çÀÌÆ®ÀÇ ¸ÞÀÎ È­¸éÀ» Ãâ·Â ÇÏ´Â ÇÔ¼ö ÀÔ´Ï´Ù. ÀÌÀåÀÇ Ã³À½ ¸ÞÀÎ È­¸é ±×¸²À» Âü°í Çϼ¼¿ä.

Àü´Þ ÀÎÀÚ

    main_view($username,$connect)

    /* $username´Â ÇØ´ç IDÀÇ ¼¼¼ÇÀ¸·Î ¸¸µé¾îÁø À¯Àú ID¸¦ Àü´Þ ¹Þ±â À§ÇÔ ÀÔ´Ï´Ù.

       Áï ¸ÞÀÎ È­¸éÀÇ ·Î±×ÀÎ »óŸ¦ º¸¿© ÁÖ±â À§Çؼ­ ÀÔ´Ï´Ù. $connect´Â Mysql Á¢¼Ó º¯¼ö ÀÔ´Ï´Ù. */

Mysql Á¢¼Ó Queryµé

    mysql_select_db(adminp,$connect);
    /* adminp µ¥ÀÌÅÍ º£À̽º¸¦ ¼±Åà ÇÕ´Ï´Ù.
        
    ÀÌ°ÍÀº µÚ µ¥ÀÌÅÍ º£À̽º À¯Æ¿¸®Æ¼¸¦ ¸¸µé ¶§ »ý¼ºÇÏ´Â µ¥ÀÌÅÍ º£À̽ºÀÌç ÀÚ·á½Ç°ú °æ¸Å °Ô½ÃÆÇÀÇ Á¤º¸¸¦ ´ã°í ÀÖ½À´Ï´Ù. */


    $ally = mysql_query("select no,title,mview,view from admin  order by no ",$connect);
    /* adminp µ¥ÀÌÅÍ º£À̽º¿¡ admin Å×À̺í(°æ¸Å °Ô½ÃÆÇ)ÀÇ ÀÎÀÚ¸¦ °Ë»ö ÇÕ´Ï´Ù.
        
    no - °Ô½ÃÆÇ ¹øÈ£ , title - °Ô½ÃÆÇ Á¦¸ñ , mview - °Ô½ÃÆÇ Ã¹ ¹ø° Å×ÀÌºí ¸í , view - °Ô½ÃÆÇ µÎ ¹ø° Å×ÀÌºí ¸í */


    $ally2 = mysql_query("select no,title,mview,view from file  order by no ",$connect);
    /* adminp µ¥ÀÌÅÍ º£À̽º¿¡ file Å×À̺í(ÀÚ·á½Ç °Ô½ÃÆÇ)ÀÇ ÀÎÀÚ¸¦ °Ë»ö ÇÕ´Ï´Ù. */


    $put = mysql_fetch_array($ally);
    $put2 = mysql_fetch_array($ally2);
    /* º¯¼ö put , put2·Î °¢ °Ë»ö °á°ú¸¦ ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù. */


    mysql_select_db('libchal',$connect);
    /* libchal µ¥ÀÌÅÍ º£À̽º¸¦ ¼±Åà ÇÕ´Ï´Ù. */


    $allya = mysql_query("select no,title,hit from $put[mview]  order by hit desc",$connect);
    /* libchal µ¥ÀÌÅÍ º£À̽º¿¡¼­ ÇØ´ç °æ¸Å °Ô½ÃÆÇ Å×À̺í Áß È÷Æ® ¼ö°¡ °¡Àå ³ôÀº ±ÛÀ» °Ë»ö ÇÕ´Ï´Ù. */


    $allyb = mysql_query("select no,title,hit from $put2[mview] order by hit desc",$connect );
    /* libchal µ¥ÀÌÅÍ º£À̽º¿¡¼­ ÇØ´ç ÀÚ·á½Ç °Ô½ÃÆÇ Å×À̺í Áß È÷Æ® ¼ö°¡ °¡Àå ³ôÀº ±ÛÀ» °Ë»ö ÇÕ´Ï´Ù. */


    $put3 = mysql_fetch_array($allya);
    $put4 = mysql_fetch_array($allyb);
    /* put3 , put4 º¯¼ö¿¡ ÇØ´ç °Ë»ö °á°ú¸¦ ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù. */


    $t_num=mysql_num_rows($ally);
    $t_num2=mysql_num_rows($ally2);
    /* °¢ °Ë»ö °á°úÀÇ ¼ö¸¦ º¯¼ö¿¡ ÀúÀå ÇÕ´Ï´Ù. */


    $wdate = date('H:i:s');
    /* ÇØ´ç º¯¼ö¿¡ Áö±Ý ³¯Â¥¸¦ ÀúÀå ÇÕ´Ï´Ù. */

»ç¿ëÀÚ ID¿Í ¼¼¼Ç È®ÀÎ

    if($username)
    {
      $sslogin = "$username login Çß½À´Ï´Ù.";
      /* µî·ÏµÈ ID·Î Á¢¼Ó ÇßÀ» °æ¿ì ÇØ´ç ID¸¦ º¯¼ö¿¡ ÀúÀå ÇÕ´Ï´Ù. */


      $chat_mod ="<a href ='userin.php?chanl=chat&username=$username' >";
      /* µî·ÏµÈ ID·Î Á¢¼Ó ÇßÀ» °æ¿ì ÇØ´ç ID·Î äÆà ¸ðµå¸¦ ¸µÅ© ÇÕ´Ï´Ù. */
    }


    if(!$username)
    {
      $sslogin = "Login Çϼ¼¿ä~!";
      $userss = "<a href ='userin.php?chanl=main'>";
    }
    /* µî·ÏµÈ ID·Î Á¢¼ÓÀ» ÇÏÁö ¾Ê¾ÒÀ» °æ¿ì °¢ º¯¼ö ÀÔ´Ï´Ù. */


    if($username == guest)
    {
      $sslogin = "$username login Çß½À´Ï´Ù.";
      $userss = "<a href ='userin.php?chanl=main'>";
    }
    /* Á¢¼ÓÇÑ ID°¡ guestÀÏ °æ¿ì º¯¼ö °ªµé ÀÔ´Ï´Ù. */

»ç¿ëÀÚ Á¢¼Ó ¹× äÆà ¸ðµå Ãâ·Â

    <tr>
    <font style='font-size:12px;color:gray'>
    $userss
    (ȸ¿ø °¡ÀÔ)
    </a>
    /* µî·ÏµÈ ID °¡ ¾Æ´Ò °æ¿ì ȸ¿ø °¡ÀÔÀ» ¸µÅ© ÇÕ´Ï´Ù. */


    (gestÀÔÀåÀº id¿¡ guestÀÔ·Â)
    $chat_mod
    (Chating)
    </a>
    </font>
    /* µî·ÏµÈ ID·Î ·Î±×ÀÎ ÇßÀ» °æ¿ì äÆà ¸ðµå¸¦ ¸µÅ© ÇÕ´Ï´Ù. */

ÀԷ¶õ°ú ·Î±×ÀÎ ·Î±×¾Æ¿ô ¹öÆ° ¸¸µé±â

    <form method=post action=userin.php>
    <input type=hidden name=chanl value=login>
    /* ID ÀÔ·Â Ç׸ñÀÇ form¹®ÀÇ ½ÃÀÛ ÀÔ´Ï´Ù. Chanl º¯¼öÀÇ °ªÀº login À̸ç userin.php¿¡ Àü´Þ ÇÕ´Ï´Ù. */


    <td width=90 bgcolor=#808080 align=center>
    <font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~ID</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=text name=id size=9></font></td>
    /* µî·ÏµÈ ID¸¦ ÀÔ·Â ÇÏ´Â Ç׸ñÀ» Ãâ·Â ÇÏ°í, id º¯¼ö·Î ÀÔ·Â µË´Ï´Ù. */


    <td width=50 bgcolor=black>
    <img src=icon.jpg border=0 align=center>
    </td>


    <td bgcolor=black  align=left>
    <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
    <a href ='m.php?chanl=main_view&f=$put2[mview]&f2=$put2[view]&ssid=$username' >
    /* µî·ÏµÈ ÀÚ·á½Ç °Ô½ÃÆÇÀÇ Ã³À½ ÀÚ·á½ÇÀ» ¸µÅ© ÇÕ´Ï´Ù.
        
       ÀÚ·á½Ç Å×À̺íÀÇ ½ÇÇàÀº m.phpÆÄÀÏÀ̸ç f,f2´Â ÇØ´ç ÀÚ·áÇÀÇ Å×À̺í ÀÔ´Ï´Ù.

       ±×¸®°í, ssid´Â ·Î±×ÀÎÇÑ ID ÀÔ´Ï´Ù. */


    <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
    $put2[title]</font></a>
    </td>
    </tr>


    <tr>
    <td width=90 bgcolor=#808080><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <b>~Passwd</b></font></td>
    <td bgcolor=black><font style='font-size:13px;font-style:italic;color:#fffff0'>
    <input type=password name=passwd size=9></font></td>
    /* ÇØ´ç IDÀÇ Æнº¿öµå¸¦ ÀÔ·ÂÇÏ´Â ºÎºÐ À̸ç passwd º¯¼ö¿¡ ÀúÀå µË´Ï´Ù. */


    <td width=50 bgcolor=black align=left>
    <img src=icon.jpg border=0 align=center>
    </td>
    <td bgcolor=black  align=left>
    <a href ='main_view.php?chanl=main_view&f=$put[mview]&f2=
    /* µî·ÏµÈ °æ¸Å °Ô½ÃÆÇÀÇ Ã³À½ °æ¸Å¸¦ ¸µÅ© ÇÕ´Ï´Ù. */


    $put[view]&ssid=$username' >
    <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
    $put[title]</font></a></td>
    </tr>


    <tr>
    <td width=90 bgcolor=black>
    <input type=submit value=Login>
    </form>
    /* µî·ÏµÈ ID¿Í Æнº¿öµå·Î ·Î±×ÀÎ ÇÏ´Â ¹öÆ°À» »ý¼º ÇÕ´Ï´Ù. */


    </td>
    <form method=post action=userin.php>
    <input type=hidden name=chanl value=logout>
    <td bgcolor=black>
    <input type=submit value=Logout>
    </form>
    </td>
    /* ·Î±×ÀÎ ÇÑ ID¸¦ ·Î±×¾Æ¿ô ÇÏ´Â ¹öÆ°À» »ý¼º ÇÕ´Ï´Ù.  userin.php ÆÄÀÏÀÇ chanl=logout Ç׸ñÀ» ½ÇÇà ÇÕ´Ï´Ù. */

¼îÇÎ ¸ô¿¡ ¼±Åà ¸¸µé±â

    <td bgcolor=black  align=left>
    <font style='font-size:13px;text-decoration:none;font-style:italic;color:blue'>
    <form method=post action=shop.php>cry~
    <select name=sel>
    <option value=1 selected>ÀüÀÚÁ¦Ç°
    <option value=2>ÀÇ·ù
    <option value=3>À½¾Ç
    <option value=4>Ã¥
    </select>!shop</font>
    <input type=submit value=~Go>
    </td>
    </form>
    /* sel º¯¼ö·Î °¢ ¼îÇÎ ¸ô¿¡ÀÇ Á¾·ù¸¦ Àü´Þ ÇÕ´Ï´Ù. ±×¸®°í Go ¹öÆ°À» »ý¼º ÇÕ´Ï´Ù. */

Top ÀÚ·á ¿Í Top °æ¸Å Ãâ·Â Çϱâ

    <table border=0 cellspacing=2 cellpadding=2 width=700 >
    <td bgcolor=black  align=center width=200>
    <font style='font-size:13px;font-style:italic;color:white'>
    <img src=icon.jpg border=0 align=center>Top ÀÚ·á</font></td>
    <td bgcolor=black  align=left width=500>
    <a href ='m.php?chanl=title&no=$put4[no]&f=$put2[mview]&f2=
    $put2[view]&ssid=$username' >
    /* ÇØ´ç ÀÚ·á½ÇÀÇ È÷Æ® ¼ö°¡ Á¦ÀÏ ³ôÀº ÀڷḦ ¸µÅ© ÇÕ´Ï´Ù. */


    <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
    <strong>$put4[title]</strong></font></a></td>
    /* $put4[title]Àº µî·ÏµÈ ÀÚ·á½ÇÀÇ È÷Æ® ¼ö°¡ Á¦ÀÏ ³ôÀº ÀڷḦ Ãâ·Â ÇÕ´Ï´Ù. */
    <tr>


    <td bgcolor=black  align=center width=200>
    <font style='font-size:13px;font-style:italic;color:white'>
    <img src=icon.jpg border=0 align=center>Top °æ¸Å</font></td>
    <td bgcolor=black  align=left width=500>
    <a href ='main_view.php?chanl=title&no=$put3[no]&f=
    $put[mview]&f2=$put[view]&ssid=$username' >
    /* µî·ÏµÈ °æ¸Å Áß È÷Æ® ¼ö°¡ Á¦ÀÏ ³ôÀº °æ¸Å¸¦ ¸µÅ© ÇÕ´Ï´Ù. */


    <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
    <strong>$put3[title]</strong></font></a></td>
    /* $put3[title]´Â µî·ÏµÈ °æ¸Å Áß È÷Æ® ¼ö°¡ Á¦ÀÏ ³ôÀº °æ¸Å¸¦ Ãâ·Â ÇÕ´Ï´Ù. */
    </tr>
    </table>

¸¸µé¾îÁø ÀÚ·á½Ç ¸ðµÎ Ãâ·Â Çϱâ

    ÀÌ°ÍÀº µ¥ÀÌÅÍ º£À̽º admin¿¡¼­ »õ·Ó°Ô »ý¼ºÇß´ø ÀÚ·á½Ç¿¡ ´ëÇØ È­¸é¿¡ Ãâ·Â ÇÏ´Â ºÎºÐ ÀÔ´Ï´Ù.


    for($pd=1 ; $pd < $t_num2 ; $pd++)

    {
    /* $t_num2´Â µî·ÏµÈ ÀÚ·á½ÇÀÇ ¼ö ÀÔ´Ï´Ù. */


    $put2 = mysql_fetch_array($ally2);
    /* ÇØ´ç ÀÚ·á½ÇÀÇ Á¤º¸¸¦ ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù. $ally2 º¯¼ö´Â ÇØ´ç ÀÚ·á½ÇÀÇ Á¤º¸¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. */

    echo("
    <tr>
    <td bgcolor=black align=center width=200>
    <img src=icon.jpg border=0 align=center></td>


    <td bgcolor=black  align=left width=500>
    <a href ='m.php?chanl=main_view&f=$put2[mview]&f2=$put2[view]&ssid=$username' >
    /* µî·ÏµÈ ÀÚ·á½ÇÀ» Çϳª¾¿ ¸µÅ© ÇÕ´Ï´Ù. For¹®¿¡ ÀÇÇؼ­ ½ÇÇà ÇÕ´Ï´Ù. */


    <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
    <strong>$put2[title]</strong></font></a></td>
    </tr>
    /* µî·ÏµÈ ÀÚ·á½ÇÀÇ Á¦¸ñÀ» Çϳª¾¿ Ãâ·Â ÇÕ´Ï´Ù.
        
       ÀÌ°ÍÀº Á¦ÀÏ Ã³À½ ¸ÞÀÎ È­¸é¿¡ Ãâ·ÂÇÑ ÀÚ·á½ÇÀ» Á¦¿ÜÇÑ ±× ´ÙÀ½ Ú·á½ÇºÎÅÍ ÀÔ´Ï´Ù. */
    ");
    }

¸¸µé¾îÁø °æ¸Å °Ô½ÃÆÇ ¸ðµÎ Ãâ·ÂÇϱâ

    for($pd=1 ; $pd < $t_num ; $pd++)
    {
    /* $t_num Àº ¸¸µç °æ¸Å °Ô½ÃÆÇÀÇ ÃÑ ¼ö ÀÔ´Ï´Ù. */


    $put = mysql_fetch_array($ally);
    /* ÇØ´ç °æ¸Å °Ô½ÃÆÇÀÇ Á¤º¸¸¦ ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù. */


    echo("
    <tr>
    <td bgcolor=black align=center width=200>
    <img src=icon.jpg border=0 align=center></td>
    <td bgcolor=black  align=left width=500>
    <a href ='main_view.php?chanl=main_view&f=$put[mview]&f2=
    $put[view]&ssid=$username' >
    /* ÇØ´ç °æ¸Å °Ô½ÃÆÇÀ» Çϳª¾¿ ¸µÅ© ÇÕ´Ï´Ù. For¹®¿¡ ÀÇÇØ ÇöÀç ¸¸µé¾îÁø °Ô½ÃÆÇÀÇ ¼ö¸¸Å­ µÇÇ®ÀÌ ÇÕ´Ï´Ù. */


    <font style='font-size:13px;text-decoration:none;font-style:italic;color:gray'>
    <strong>$put[title]</strong></font></a></td>
    </tr>
    /* ÇØ´ç °Ô½ÃÆÇÀÇ Á¦¸ñÀ» Ãâ·Â ÇÕ´Ï´Ù. */
    ");
    }

userin.php Àüü ÄÚµå

    userin_func.php ÆÄÀÏÀÇ ÇÔ¼öµéÀ» ÀÌ¿ëÇؼ­ È­¸é¿¡ Ãâ·ÂÇÏ´Â ÆÄÀÏ ÀÔ´Ï´Ù.


    <?php

    include('userin_func.php');


    if($chanl == main_view || !$chanl)
    {
      main_view($username,$connect);
    }


    if($chanl == main)
    {
      main_userin($sel);
    }


    if($chanl == in)
    {
      error_user($connect,$id,$name,$passwda,$passwdb,$emaila,$emailb,$rsda,$rsdb,$telb,$telc,$uno,$uno2,$address);


      $wdate = date('y-m-d');
      $resident = "$rsda-$rsdb" ;
      $email = "$emaila@$emailb" ;
      $tel1 = "$tela-$telb-$telc" ;
      $tel2 = "$tel2a-$tel2b-$tel2c" ;
      $uno = "$uno-$uno2" ;


      mysql_query("insert into userin(name,id,passwd,resident,email,homepage,address,tel1,tel2,wdate,uno)
                  values('$name','$id',password('$passwda'),'$resident','$email',
                         '$home','$address','$tel1','$tel2','$wdate','$uno')",$connect);


      if($sel == user_edit)
      {
        echo("
        <html>
        <body>
        <center>
        <form method=post action=db_view.php>
        <font style='font-size:13px;font-style:italic;color:#808080'>
        <b>ȸ¿ø °¡ÀÔÀÌ µÇ¾ú½À´Ï´Ù.</b></font>
        <input type=hidden name=chanl value=user_edit>
        <input type=submit value=È®ÀÎ>
        </form>
        </center>
        </body>
        </html>
        ");
      }
      else
      {
        echo("
        <html>
        <body>
        <center>
        <form method=post action=userin.php>
        <font style='font-size:13px;font-style:italic;color:#808080'>
        <b>ȸ¿ø °¡ÀÔÀÌ µÇ¾ú½À´Ï´Ù.</b></font>
        <input type=hidden name=no value=$no>
        <input type=hidden name=chanl value=main_view>
        <input type=submit value=È®ÀÎ>
        </form>
        </center>
        </body>
        </html>
        ");
      }
    }


    if($chanl == checkid)
    {
      $ally = mysql_query("select id from userin where id='$id'",$connect);
      $userin = mysql_fetch_array($ally);


      if($userin[id] || !$id)
      {
        echo("
        <script>
        window.alert('°°Àº id°¡ Àְųª °ø¶õ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");
        exit;
      }
      else
      {
        echo("
        <script>
        window.alert('»ç¿ë °¡´ÉÇÑ id ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");
        exit;
      }
    }


    if($chanl == login)
    {
      $ally = mysql_query("select id,passwd from userin where id='$id'",$connect);
      $userin = mysql_fetch_array($ally);
      $passwput = mysql_query("select password('$passwd')");
      $passwput1 = mysql_result($passwput,0,0);


      if($userin[passwd] != $passwput1 || !$id )
      {
        echo("
        <script>
        window.alert('id,passw°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");
        exit;
      }


      if($userin[passwd] == $passwput1 && $userin[id] == $id || $id == guest)
      {
        session_start();
        $username = "$id";
        session_register( "username");
        main_view($username,$connect);
      }
      else
      {
        echo("
        <script>
        window.alert('id,passw°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");
        exit;
      }
    }


    if($chanl == chat)
    {
      echo("
      <html>
      <body>
      <center>
      <script>
      window.open('chat.php','send','height=100px width=325px')
      window.open('chat_view.php','send2','height=200px width=325px')
      </script>
      </center>
      </body>
      </html>
      ");

      main_view($username,$connect);
    }


    if($chanl == logout)
    {
      session_start();
      session_destroy("username");
      main_view($username,$connect);
    }

    ?>

¼Ò½º ¼³¸í

    ÀÌ ÆÄÀÏÀº userin_func.php ÆÄÀÏÀÇ ÇÔ¼öµéÀ» º¸´Ù ´Ù¾çÇÑ ¹æ¹ýÀ¸·Î È­¸é¿¡ Ãâ·Â ÇÏ°Ô²û ±¸¼ºµÈ ÆÄÀÏ ÀÔ´Ï´Ù. 

    ´Ü¼øÈ÷ if¹®ÀÇ ³ª¿­¸¸ Á¸Àç ÇÏÁö¸¸ ÀÌ°ÍÀº $chanl À̶ó´Â º¯¼ö¸¦ µÒÀ¸·Î Çؼ­ °¢°¢ÀÇ chanl¿¡ µû¶ó Ãâ·Â ÇÏ´Â
        
    È­¸éÀÌ ´Þ¶ó Áý´Ï´Ù.

¸ÞÀÎ È­¸é Ãâ·Â

    <?php

    include('userin_func.php');
    /* userin_func.php ÆÄÀÏÀ» Æ÷ÇÔ ÇÕ´Ï´Ù. ÀÌ°ÍÀº ÀÌ ÆÄÀÏ ¾ÈÀÇ ÇÔ¼öµéÀ» »ç¿ë Çϱâ À§ÇÔ ÀÔ´Ï´Ù. */


    if($chanl == main_view || !$chanl)
    {
      main_view($username,$connect);
    }
    /* $chanl ÀÌ ¾ø°Å³ª ¶Ç´Â main_view À϶§ ¸ÞÀÎ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */

ȸ¿ø °¡ÀÔ Ãâ·Â°ú µ¥ÀÌÅÍ º£À̽º ÀÔ·Â

    if($chanl == main)
    {
      main_userin($sel);
    }
    /* $chanl ÀÌ main ÀÏ ¶§ ȸ¿ø °¡ÀÔ È­¸éÀ» Ãâ·Â ÇÕ´Ï´Ù. */


    if($chanl == in)
    {

      error_user($connect,$id,$name,$passwda,$passwdb,$emaila,$emailb,$rsda,$rsdb,$telb,$telc,$uno,$uno2,$address);
      /* $chanlÀÌ inÀÏ ¶§ Àü´Þ µÇ¾î¿Â ȸ¿ø Á¤º¸¸¦ ÀÔ·Â ÇÏ´Â ºÎºÐ ÀÌ¸ç °¢ ÀÎÀڵ鿡 ´ëÇØ ¿¡·¯ ¿©ºÎ¸¦ üũ ÇÕ´Ï´Ù. */
      

      $wdate = date('y-m-d');
      $resident = "$rsda-$rsdb" ;
      $email = "$emaila@$emailb" ;
      $tel1 = "$tela-$telb-$telc" ;
      $tel2 = "$tel2a-$tel2b-$tel2c" ;
      $uno = "$uno-$uno2" ;
      /* ÁֹιøÈ£ , ¸ÞÀÏ , ÀüÈ­¹øÈ£ , ¿ìÆí¹øÈ£¿¡ ´ëÇØ °¢°¢ÀÇ Çü½Ä¿¡ ¸Â°Ô ¸¸µì´Ï´Ù. */


      mysql_query("insert into userin(name,id,passwd,resident,email,homepage,address,tel1,tel2,wdate,uno)
           values('$name','$id',password('$passwda'),'$resident','$email',
                  '$home','$address','$tel1','$tel2','$wdate','$uno')",$connect);
      /* Àü´Þ µÇ¾î¿Â °¢ ȸ¿ø Á¤º¸°¡ ¿¡·¯°¡ ¾ø´Ù¸é userin Å×ÀÌºí¿¡ ÀÔ·Â ÇÕ´Ï´Ù. */


      if($sel == user_edit)
      {
      /* $sel ÀÌ user_edit À̸é admin Ç׸ñ¿¡¼­ ÀÏ¹Ý À¯Àú¸¦ µî·ÏÇÑ °ÍÀ̸ç, »õ·Î¿î ȸ¿øÀ» µî·Ï ½ÃŲ ÈÄ ´Ù½Ã
          
         admin Ç׸ñÀ¸·Î µÇµ¹¾Æ °©´Ï´Ù. */


         echo("
         <html>
         <body>
         <center>
         <form method=post action=db_view.php>
         <font style='font-size:13px;font-style:italic;color:#808080'>
         <b>ȸ¿ø °¡ÀÔÀÌ µÇ¾ú½À´Ï´Ù.</b></font>
         <input type=hidden name=chanl value=user_edit>
         <input type=submit value=È®ÀÎ>
         </form>
         </center>
         </body>
         </html>
         ");
      }
      else
      {
         /* else °æ¿ì $sel °ªÀÌ ¾ø´Â °æ¿ì À̸ç, ÀÏ¹Ý »ç¿ëÀÚµéÀÌ È¸¿ø °¡ÀÔÀ» ÇÒ °æ¿ì °¡ÀÔÇÑ ÈÄ¿¡ ´Ù½Ã
                 
            ¸ÞÀÎ È­¸éÀ¸·Î À̵¿ÇÕ´Ï´Ù. */

        echo("
        <html>
        <body>
        <center>
        <form method=post action=userin.php>
        <font style='font-size:13px;font-style:italic;color:#808080'>
        <b>ȸ¿ø °¡ÀÔÀÌ µÇ¾ú½À´Ï´Ù.</b></font>
        <input type=hidden name=no value=$no>
        <input type=hidden name=chanl value=main_view>


        <input type=submit value=È®ÀÎ>
        </form>
        </center>
        </body>
        </html>
        ");

      }
    }

ID üũ Ç׸ñ

    if($chanl == checkid)
    {
      $ally = mysql_query("select id from userin where id='$id'",$connect);
      $userin = mysql_fetch_array($ally);
      /* $chanlÀÌ checkidÀÏ °æ¿ì ¼öÇàÇϸç, userinÅ×ÀÌºí¿¡¼­ Àü´Þ µÇ¾î¿Â IDÀÇ Á¸Àç ¿©ºÎ¸¦ °Ë»ö ÇÏ°í °á°ú¸¦
          
         ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù. */


      if($userin[id] || !$id)
      {
        echo("
        <script>
        window.alert('°°Àº id°¡ Àְųª °ø¶õ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");
        exit;
      }
      /* Àü´Þ µÇ¾î¿Â ID°¡ ¾ø°Å³ª ¶Ç´Â ÇØ´ç ID°¡ userin Å×ÀÌºí¿¡ ÀÖÀ» °æ¿ì Ãâ·Â ÇÏ´Â È­¸é ÀÔ´Ï´Ù. */
          
      else
      {
        echo("
        <script>
        window.alert('»ç¿ë °¡´ÉÇÑ id ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");

        exit;
      }
      /* ±× ¹ÛÀÇ °æ¿ì »ç¿ë °¡´ÉÇÑ IDÀÓÀ» Ãâ·Â ÇÕ´Ï´Ù. */
    }

login ó¸®

    if($chanl == login)
    {
      $ally = mysql_query("select id,passwd from userin where id='$id'",$connect);
      $userin = mysql_fetch_array($ally);
      $passwput = mysql_query("select password('$passwd')");
      $passwput1 = mysql_result($passwput,0,0);

      /* $chanlÀÌ loginÀÏ ¶§ userinÅ×ÀÌºí¿¡¼­ Àü´Þ µÇ¾î¿Â ID¿¡ ´ëÇØ °Ë»öÇÏ°í, °á°ú¸¦ ¹è¿­·Î ÀúÀå ÇÕ´Ï´Ù.
          
      ±×¸®°í, Àü´ÞµÇ¾î¿Â Æнº¿öµå¸¦ ¾Ïȣȭ Çؼ­ º¯¼ö¿¡ ÀúÀå ÇÕ´Ï´Ù. */


      if($userin[passwd] != $passwput1 || !$id )
      {
        echo("
        <script>
        window.alert('id,passw°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");

        exit;
      }
      /* Àü´Þ µÇ¾î¿Â ID°¡ ¾ø°Å³ª ¶Ç´Â Àü´Þ µÇ¾î¿Â Æнº¿öµå¿Í °Ë»öÇÑ Æнº¿öµå°¡ °°Áö ¾ÊÀ» °æ¿ì Ãâ·Â ÇÏ´Â È­¸é ÀÔ´Ï´Ù. */


      if($userin[passwd] == $passwput1 && $userin[id] == $id || $id == guest)
      {
        session_start();
        $username = "$id";
        session_register( "username");
        main_view($username,$connect);
      }
      /* Àü´Þ µÇ¾î¿Â Æнº¿öµå,ID°¡ °Ë»öÇÑ Æнº¿öµå,ID ¿Í °°À» °æ¿ì ¶Ç´Â Àü´Þ µÇ¾î¿Â ID°¡ guest ÀÏ °æ¿ì
          
      ÇØ´ç ID¿¡ ´ëÇØ ¼¼¼ÇÀ» ¸¸µì´Ï´Ù. */

      else
      {
        echo("
        <script>
        window.alert('id,passw°¡ Ʋ¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä')
        history.go(-1)
        </script>
        ");

        exit;
      }
      /* ±× ¹ÛÀÇ °æ¿ì Ãâ·Â ÇÏ´Â È­¸é ÀÔ´Ï´Ù. */

    }

äÆà â ¶ç¿ì±â

    if($chanl == chat)
    {
      echo("
      <html>
      <body>
      <center>
      <script>
      window.open('chat.php','send','height=100px width=325px')
      window.open('chat_view.php','send2','height=200px width=325px')
      /* $chanl ÀÌ chatÀÏ ¶§ µÎ°³ÀÇ Ã¤Æà âÀ» ¶ç¿ó´Ï´Ù. °£´ÜÇÑ java ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÑ ¹æ¹ý ÀÔ´Ï´Ù. */
      </script>
      </center>
      </body>
      </html>
      ");

      main_view($username,$connect);
    }

logout Çϱâ

    if($chanl == logout)
    {
      session_start();
      session_destroy("username");
      main_view($username,$connect);
    }
    /* $chanlÀÌ logoutÀÏ °æ¿ì Á¢¼ÓÇÑ IDÀÇ ¼¼¼ÇÀ» Á¦°Å ÇÕ´Ï´Ù. */

        
    ´ÙÀ½ Àå¿¡¼­´Â ÀÚ·á½Ç¿¡ ´ëÇØ ¼³¸í ÇÏ°Ú½À´Ï´Ù.

´ÙÀ½ ÀÌÀü Â÷·Ê