Page 2 of 2

Combining VBScripts with PHP

Posted: Sun Aug 11, 2002 9:22 pm
by Hebbs
I have got back to this after a bit of a break on other tasks.

I havent used VBScripts before but have managed to get most of Waynes code working.

The problem Im having is with the line

Code: Select all

if UserName <> "Unknown" then 
      document.location = "autologon.php?username=" & UserName
I presume this should carry the value of username to a autologon.php page, however I keep getting a recurring error message at this point saying that there is an error on this line with the description "

object required. 'document'

I have created the autologon.php script and it is in the same directory as the running script.

Any ideas?

Hebbs

Posted: Mon Aug 12, 2002 3:56 am
by Wayne
That sounds a little funny, but anyway, if the script is included and called correctly from the html page that you are calling, the only thing I can think of is try changing the

Code: Select all

document.location
to

Code: Select all

window.location

Posted: Mon Aug 12, 2002 8:03 pm
by Hebbs
Wayne,

I have never played with VBScript before and am thinking I might have something simple wrong here.

In your original post you provided this:

Code: Select all

<script TYPE="text/vbscript" language="VBScript" src="scripts.vbs">
I understand that this goes in the header of the calling html page and that the actual script sits in the src 'scripts.vbs'. I take it that this page executes the subroutine from scripts.vbs and should then carry the value direct to autologin.php, Yes?

What I have is three pages.

The first is the initiating page which calls the sub, I have it like this:

Code: Select all

<html>
<head>
    <script TYPE="text/vbscript" language="VBScript" src="scripts.vbs">

	<body onLoad="User();">
</script>
</head>

</body>
</html>
The second page is the scripts.vbs.

The third is the php page in which Im testing for the variable, something like this:

Code: Select all

<html>
<head>
	<title>Untitled</title>
</head>

<body>
<?php
echo "Username = $username";
?>
</body>
</html>
Having read your last I think I may have the bull by the wrong end. Can you confirm/deny this for me?

Hebbs

Posted: Tue Aug 13, 2002 3:19 am
by Wayne
Your probably right, it looks like these changes should do it. Change your first page to this.

Code: Select all

<html> 
<head> 
    <script TYPE="text/vbscript" language="VBScript" src="scripts.vbs"> 
    </script> 
</head> 

<body onLoad="User();"> 

</body> 
</html>

Posted: Tue Aug 13, 2002 3:54 am
by firepages
If you are running apache just use mod_sspi or any of the NT authentication modules that are out there http://modules.apache.org/

Posted: Fri Aug 16, 2002 3:38 am
by volka
(in addition to the last post)
Yesterday configuring a new apache installation I stumbled (accidentally) over Kerberos Apache module.
it retrieves a username/password pair from the browser and checks them against a Kerberos server as set up by your particular organization.
w2k/active directory uses kerberos for authentication by default.
I have no w2k server at hand so can't test it....

Posted: Fri Sep 20, 2002 5:46 am
by Wayne
does anyone know if these programs/modules will work if your http requests are passed through a proxy server??