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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript in HTML

Status
Not open for further replies.

GRXboxers

Programmer
Feb 9, 2005
9
NL
Can anyone please tell me what is wrong with this:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>
<SCRIPT LANGUAGE="VBScript">
<!--
Dim MyVar
MyVar = MsgBox ("Do not continue if you dont know the password, because it might crash your PC!!!n00b!!!, 4145, "Homie4life")
MyVar1 = Inputbox("Enter password")
MyVar2 = MsgBox ("Have a nice day!, 4160, "Homie4life")
If Input = "sixisgay" than
MyVar = MsgBox ("Password accepted!!!11!own3r!!11", 4160, "Homie4life")
End If
End MyVar
-->
</SCRIPT>
</body>

</html>

Microsoft Frontpage says it is error number 14 ")" is expected :S
 
Where 2 begin?

You don't need to 'Dim MyVar' unless you first 'Option Explicit', which you haven't, or it's an array, which it isn't.

MyVar is going to be either 1 (OK) or 2 (Cancel), If you don't have an enter after the n00b!!!, and the statement is wrapping naturally. Else, it is the likely source of your error.

You ignore this value.

MyVar1 is whatever the user puts in the blank.

You ignore this value.

MyVar2 is going to be 1 (OK)

You ignore this value.

If input blah blah blah

End If

Will never get processed, because you have never made the variable 'input' equal to anything, so the statement always fails.

End MyVar - End implies the end of something, function, if statement, select, etc. MyVar was dim'ed as a single value, once set, it's over. No need to 'end'.

Good luck on your l33t webpage....:)
 
You may simplify like this:
<SCRIPT LANGUAGE="VBScript">
<!--
Dim MyVar
MsgBox "Do not continue if you dont know the password, because it might crash your PC!!!n00b!!!", 4145, "Homie4life"
MyVar = Inputbox("Enter password")
MsgBox "Have a nice day!", 4160, "Homie4life"
If MyVar = "sixisgay" Then
MsgBox "Password accepted!!!11!own3r!!11", 4160, "Homie4life"
End If
-->
</SCRIPT>

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
>[tt]MyVar2 = MsgBox ("Have a nice day!, 4160, "Homie4life")
MyVar2 = MsgBox ("Have a nice day![red]"[/red], 4160, "Homie4life")[/tt]
>[tt]End MyVar[/tt]
What is it?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top