session_start(); ?>
require_once("DBUSER.php");
$userid = $_POST['userid'];
$userpwd = $_POST['userpwd'];
DBGOUT("[POST.userid] ".$_POST['userid']);
DBGOUT("[POST.userpwd] ".$_POST['userpwd']);
$usersha = hash("sha256", $userpwd);
$rs = DBUSER::login_sha($userid, $usersha, $errstr);
DBGOUT("[errstr] ".$errstr);
if ($errstr != "@error.no") {
//echo "";
echo "";
exit;
}
else {
$col = array();
foreach ($rs as $row) {
$col = $row;
DBGOUT("[rs] ".json_encode($row));
break;
}
DBGOUT("[0] ".json_encode($col));
$_SESSION['userid'] = $col['userid'];
$_SESSION['nologout'] = 0;
DBGOUT("session : ".$_SESSION['userid']);
echo "";
}
?>