|
Posted by Satyam on 04/04/05 17:20
One way you can do it is to put an invisible <iframe> on the same page as
the <object> which provides you the user information. When you get, via
vbscript or javascript, the userid, then you set the src property of the
<iframe> to that of a page where you will process that info, appended with
the information taken from the <object>.
<iframe id=iframename></iframe>
<object id=objectname blah, blah, blah />
Asiming the property of the ActiveX object you want to send to the PHP
server is called UserId, whenever you are sure you can read it (perhaps an
event or whatever) you do:
document.getElementById('iframename').src = 'ValidateUser.php?UserId=' +
document.getElementById('objectname').UserId
The page ValidateUser.php would receive the UserId as an argument in the URL
(and you can add as many as you want) and may reply with whatever response
is apropriate. That answer will go into the body of the iframe document.
Thus, assuming that you reply with a 0 or 1, you will get that by having an
function attached to the onLoad event of the <iframe>. The onLoad will be
triggered when a response is finally received.
The reply you will get as
document.getElementById('iframename').document.body.innerHTML
which you could check by doing a:
<iframe id=iframename
onLoad="alert(document.getElementById('iframename').document.body.innerHTML);"
/>
Satyam
"Ashley" <afogleman@rtt-law.com> wrote in message
news:20050404124818.59795.qmail@lists.php.net...
> Ok, apparently I wasn't clear enough with my explanation due to the
> responses I have received.
>
> I have a webserver (not on the same computer as the users) that is hosting
> an Intranet app. I want to obtain the username of the current person
> logged into the workstation that is connecting to the Intranet.
>
> From what I have read this is impossible to accomplish from the server
> without prompting for a username/password. I found an activeX control
> (called NWSess from Novell) that will provide the currently logged in
> user.
>
> The problem is that I need to take this variable (provided by the activeX
> control to a vbscript) and pass it to PHP so that it can be used. I don't
> typically use vbscript so I would really like to put the variable in PHP
> so that I can use it for other things.
>
> I hope this explains what I am trying to accomplish a little better and
> thank you for the responses thus far.
>
> Ashley
>
>
> Burhan Khalid wrote:
>> Ashley wrote:
>>
>>> I have a unique problem that may be able to be solved another way, but I
>>> don't know how.
>>>
>>> What I need to do is pass a variable from a vbscript into php for use.
>>>
>>> I am using vbscript to access an activeX control on the computer that
>>> grabs the currently logged in user. This works fine, but I cannot
>>> determine how I can get that value into php so that I can use it.
>>
>>
>> If PHP is running on the same computer that the user is logged into, then
>> you can use $_SERVER['REMOTE_USER'] to get the current logged in user.
[Back to original message]
|