<?php include 'db_connect.php'; include 'iconv_encodeing.php'; include 'user_name_converter.php'; $room_number = iconv_encodeing($_GET["room_number"]); $user_name = iconv_encodeing($_GET["user_name"]); $user_id = user_name_to_user_id($user_name); mysql_query("delete from participated_room where room_number = {$room_number} and participated_user_id = {$user_id}") or die("failed you can't go out"); echo "Succeed";
<?php include 'db_connect.php'; include 'iconv_encodeing.php'; include 'user_name_converter.php'; $room_number = iconv_encodeing($_GET["room_number"]); $friend_name = iconv_encodeing($_GET["friend_name"]); $friend_id = user_name_to_user_id($friend_name); mysql_query("insert into participated_room(room_number,participated_user_id) values ('{$room_number}','{$friend_id}')") or die("failed"); echo "Succeed";
<?php echo "<?xml version = '1.0' encoding = 'euc-kr'?>"; include 'db_connect.php'; include 'user_name_converter.php'; include 'iconv_encodeing.php'; $user_name = iconv_encodeing($_GET['user_name']); $user_id = user_name_to_user_id($user_name); $query = "select user_friend_name from user_friend where user_id= '{$user_id}'"; $row = mysql_query($query); echo "<Friend>"; while ($result = mysql_fetch_array($row)) { echo "<user_friend>{$result['0']}</user_friend>"; } echo "</Friend>";
<?php include 'supervisor.php'; include 'iconv_encodeing.php'; include 'user_name_converter.php'; include 'db_connect.php'; $chat = iconv_encodeing(urldecode($_GET["chat"])); $user_name = iconv_encodeing(urldecode($_GET["user_name"])); $room_number = iconv_encodeing($_GET["room_number"]); $user_id = user_name_to_user_id($user_name); $query = "insert into chat(room_number,chat,chatted_user_id,chatdate) values ('{$room_number}','{$chat}','{$user_id}',now())"; mysql_query("set names euckr"); $result = mysql_query($query) or die("failed"); echo "Succeed"; ?>
<?php include 'db_connect.php'; include 'iconv_encodeing.php'; $user_name = iconv_encodeing(urldecode($_GET["user_name"])); mysql_query("set names euckr"); $query1 = "select user_name from user where user_name = '{$user_name}' "; $rs1 = mysql_query($query1); $result = mysql_fetch_array($rs1); if (!$result[0]) { echo "Succeed!"; $query = "insert into user(user_name) values ('{$user_name}')"; mysql_query($query); } else { echo "this user_name is already exist"; }