if you're running IIS, use getenv("logon_user"); if you're running Apache, well, let me know if you figure it out!! I've tried API calls, registry reads, looked at all the environment variables, etc.
(using the windows API call to getusername returns the username from the current process, which in this case means the system account that apache is running under, I.E.
IUSER_Machinename, NT AUTHORITY)