2011-07-22, 08:31 AM
Hi guys, I'm trying to integrate a script in the forum and it fetches the user info from the cookies. At first it used to work fine but then I started using a cookie prefix, the problem is that now it doesn't fetch any online users....
here's the get function.
HELP PLEASE!!!!!!!
HELP!!!!!!!!!still none of you guys look at this one.
here's the get function.
Quote:function getUserID() {I guess adding a cookie prefix variable might work........... Can you guys help me? I'll appreciate it very much.
$userid = 0;
if (!empty($_COOKIE['sid'])) {
$sql = ("SELECT ".DB_USERTABLE_USERID." FROM ".TABLE_PREFIX."sessions WHERE sid='".mysql_real_escape_string($_COOKIE['sid'])."'");
$query = mysql_query($sql);
$session = mysql_fetch_array($query);
$userid = $session[DB_USERTABLE_USERID];
}
return $userid;
}
HELP PLEASE!!!!!!!
HELP!!!!!!!!!still none of you guys look at this one.