Retreiving client information [solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
s5034454
Forum Newbie
Posts: 3
Joined: Thu Dec 23, 2004 2:55 am
Location: Belgium

Retreiving client information [solved]

Post by s5034454 »

Hello,

I would like to give my girlfriend a CD for Christmas with some texts and other stuff, but I want to make sure that her mother doesn't open the CD. She doesn't respect my girlfriends privacy (she's 23 years old!) I've already password protected the files, but I want to KNOW this time, when her mother tries to open the CD. :twisted:

So, for my question: I've programmed an exe in VBA that links to a webpage, that mails me when somebody tries to open that file (I'll call it Private.mdb). But now, I want to know who opened it, so I KNOW this time that it was her. And for that, I need to gather as much information about the user as possible. Ideal would be her account name, but I don't think that's possible. Maybe the computer name? :?:

Just so we're clear: I don't intend to hack her computer or damage it in any way, so I don't need any passwords or stuff like that.

Oh en btw: of course I'm programming the webpage in PHP. :wink:
Last edited by s5034454 on Thu Dec 23, 2004 3:22 am, edited 1 time in total.
s5034454
Forum Newbie
Posts: 3
Joined: Thu Dec 23, 2004 2:55 am
Location: Belgium

Post by s5034454 »

Updat: I've found a way to get the computername. I just get it in VBA (Environ("ComputerName")) and then send it to the webpage as a parameter. But I would still like to get the username of the person that is logged in.
s5034454
Forum Newbie
Posts: 3
Joined: Thu Dec 23, 2004 2:55 am
Location: Belgium

Post by s5034454 »

Update2: I'm sorry to have bothered you folks, I've also found a way to get the username in VBA (and that send to a PHP-page as parameter). For people that are interested:

You put this in a Module:

Code: Select all

Declare Function Get_User_Name Lib "advapi32.dll" Alias _
                 "GetUserNameA" (ByVal lpBuffer As String, _
                 nSize As Long) As Long
And you use this in your code (VBA)

Code: Select all

Function GetUserName() As String
    Dim lpBuff As String * 25
 
    Get_User_Name lpBuff, 25
    GetUserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
End Function
Post Reply