Forum Moderators: coopster

Message Too Old, No Replies

Problems with function

unexpected T_VARIABLE in the first line no matter what

         

zio_shaitan

1:55 am on Dec 4, 2003 (gmt 0)

10+ Year Member



I get unexpected T_VARIABLE(or T_anything) in the first line of the function no matter what i put there or where i put the function.
Anyone knows what the problem might be?

Here's the code

session_start();//starts a new session
function getUsersOnline()
{

    $handle = opendir(session_save_path());
    if ($handle == false) return -1;

    while (($file = readdir($handle))!= false)
{
        if (ereg("^sess", $file)) $count++;
    }
    closedir($handle);

    return $count;
}

Thanks in advance

DrDoc

3:13 am on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ereg("^sess", $file)

should be

ereg("/^sess/", $file)