$RPATH = getenv("DOCUMENT_ROOT");
require($RPATH."/inc/total.lib");
require($RPATH."/inc/util.inc");
require($RPATH."/inc/utilFunc.php");
$conn = mysql_connect($sqlhost,$sqluser,$sqlpwd) or die("db ¼¹ö ¿¬°É¿À·ù");
mysql_select_db($sqldb, $conn);
if($xopt == "login")
{
if(!$id)
{
echo "";
exit;
}
$conn = mysql_connect($sqlhost,$sqluser,$sqlpwd) or die("db ¼¹ö ¿¬°É¿À·ù");
mysql_select_db($sqldb, $conn);
$que ="select * from userinfo where id='$id'";
$result = mysql_query($que, $conn);
if(!$result)
{
echo "";
exit;
}
$chk =mysql_num_rows($result);
if(!$chk)
{
echo "";
exit;
}
$row = mysql_fetch_array($result);
$pwd2 = $row["pwd"];
$name = $row["name"];
$jumin1 = $row["jumin1"];
$jumin2 = $row["jumin2"];
$mail = $row["mail"];
if(intval($jumin2[0]) == 1 || intval($jumin2[0]) == 3) $sex = "male";
else $sex = "female";
if(intval($jumin2[0]) == 1 or intval($jumin2[0]) == 2) $year = intval("19" . $jumin1[0] . $jumin1[1]);
else $year = intval("20" . $jumin1[0] . $jumin1[1]);
$age = date("Y") - $year +1;
if($pwd != $pwd2)
{
echo "";
exit;
} else
{
$que = "update userinfo set lastdate=now() where id='$id'";
$result = mysql_query($que, $conn);
setcookie("loginid", $id, 0, "/");
setcookie("loginname", $name, 0, "/");
setcookie("loginmail", $mail, 0, "/");
setcookie("loginsex", $sex, 0, "/");
}
if(trim($replace_url)) {
echo "";
} else {
echo "";
}
mysql_close($conn);
exit;
}
if($xopt == "logout")
{
setcookie("loginid", "", 0, "/");
setcookie("loginname", "", 0, "/");
setcookie("loginmail", "", 0, "/");
setcookie("loginsex", "", 0, "/");
if(trim($replace_url)) {
echo "";
} else {
echo "";
}
mysql_close($conn);
exit;
}
?>