Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running VB Script in a web page

Status
Not open for further replies.

mattcottrell

Technical User
Sep 18, 2002
9
GB
I am trying to create a html page which has a button on it which logs off the user.

The script works fine when I do it in VB6 but all I get is the message box when it is in the html page.

are there any limitations to what scripting you can use in html.

Here is the html script:

<HTML>
<HEAD>

<SCRIPT TYPE=&quot;text/VBScript&quot;>

Declare Function ExitWindowsEx& Lib &quot;user32&quot; (ByVal uFlags As Long, ByVal dwReserved As Long)
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1

</SCRIPT>
</HEAD>

<BODY>
<SCRIPT TYPE=&quot;text/VBScript&quot;>
Sub Button1_OnClick

MsgBox &quot;This will log you off&quot;
Call ExitWindowsEx(EWX_LOGOFF, 0)
Unload Me
End Sub
</SCRIPT>

<H3>Log off test Page</H3><HR>

<FORM><INPUT NAME=&quot;Button1&quot; TYPE=&quot;BUTTON&quot; VALUE=&quot;Log Off&quot;></FORM>
</BODY>
</HTML>



Appologies if this is the wrong forum.

Many thanks in advance
Matt Cottrell
 
At the top of the page is a search box. If you type vbscript in the box, select 'Find a Forum' and click 'Go', you'll find the VBScript forum.

It's forum329
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top