Page 756 - 3-2
P. 756

session_start();


            $step=$_GET['name'];
            $sql = "SELECT * FROM info";
            $result = mysql_query($sql);
            if (!$result) {
                echo "DB Error, could not list tables\n";
                echo 'MySQL Error: ' . mysql_error();
                exit;
            }


            while ($row = mysql_fetch_row($result)) {
                $str = strcmp($step, $row[1]);
                if(!$str){
                    echo "id: $row[0]";
                    echo "<br>";
                    echo "name: $row[1]";
                    echo "<br>";
                    echo "phone: $row[2]";
                    echo "<br>";
                    echo "password: $row[3]";
                    echo "<br>";
                }
            }


            ?>
            <a href="rental_list.php"> Go to rental list </a>
            <br>
            <a href="home.php"> Go to member list </a>
            <br>
            <a href="logout.php"> Logout </a>
            </h1>
            </body>




            6) logout.php
            // 로그아웃 버튼을 누르면 login.php        로 돌아감
            <?php
            session_start();
            if(session_destroy())
            {
            header("Location: login.php");
            }
            ?>


                                                         - 756 -
   751   752   753   754   755   756   757   758   759   760   761