function get_user_id()
{
$userid = NULL;
foreach ($_COOKIE as $key => $val)
{
if (preg_match("/member_id/", $key))
{
$cookie_name = $key;
}
}
if (isset($_COOKIE[$cookie_name]))
{
$userid = $_COOKIE[$cookie_name];
}
return $userid;
}