[PHP] 纯文本查看 复制代码
/**
* 检查cookie
*
* @access public
* @param
*
* @return void
*/
function check_cookie ()
{
if ( isset($_COOKIE['ECS']) && isset($_COOKIE['ECS']['user_id']) && isset($_COOKIE['ECS']['password']))
{
$ecs_user_id = $_COOKIE['ECS']['user_id'];
$ecs_user_pass = $_COOKIE['ECS']['password'];
$sql = "SELECT " . $this->field_name ." AS user_name".
" FROM " . $this->table($this->user_table) .
" WHERE ".$this->field_id." = '$ecs_user_id' AND ".$this->field_pass." = '$ecs_user_pass'";
$username = $this->db->getOne($sql);
if ($username && ($this->charset != 'UTF8'))
{
$username = ecs_iconv($this->charset, 'UTF8', $username);
}
return $username;
}
else
{
return '';
}
}