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

passwords

Status
Not open for further replies.

jeffrowski

Technical User
Jan 16, 2007
13
GB
Hey!

I am getting really lost with vbscript! I am trying to make a script that is probably quite simple.

I want a password box to be displayed. If the correct password is entered, then it runs a hta file, if the incorrect password is entered then it runs another hta file.

I am happy if the password is embedded within the script as I never want to change it.

Can anyone help me?!
 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,

Thank you for responding. I'm a complete day 1 n00b to this!
So far I have the box! I have the text that you enter masked, but am really struggling with getting the text that is entered to be checked, let alone call up another file.
I've been searching all morning for advice! Any tips or resources that you can offer would be gratefully received.
 
Please post your code. It is much easier to understand exactly what your problem is with the code to look at.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
OK!!!

This is probably way off, but like I said before I am a total n00b! I have been trying to find a way round it, and I am not expecting any of you to do the work for me!! If you could just point me in the right direction then you would have helped enormously!

Here is what I have got:


<html>
<head>

<title>IM&T System Rebuilder</title>

<hta:application
id="MyApp"
applicationName=""
border="thick"
borderStyle="normal"
caption="yes"
contextMenu="yes"
icon=""
innerBorder="yes"
maximizeButton="yes"
minimizeButton="yes"
navigable="no"
scroll="yes"
scrollFlat="no"
selection="yes"
showInTaskBar="yes"
singleInstance="no"
sysMenu="yes"
version="1.0"
windowState="normal"
>
</head>

<body>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<script language="VBScript">
if (form.user.value=="Technician"&&form.password.value=="test999"){location="build.hta"}
else{
alert("Access Denied")
}
</script>

<center>
<table bgcolor="white" cellpadding="10" border="1" width="296">
<tr><td colspan="2" width="280" ><center><b>Please Login</b>
</center></td></tr>
<tr><td width="106"><b><font size="2">User Name:</b></td><td width="150"><form name="login-form"><input
name="user" type="text" size="20"></td></tr>
<tr><td width="106"><b><font size="2">Password:</font></b></td><td width="150"><input name="password"
type="password" size="20"></td></tr>
<tr><td width="106"><center><input type="button" value="Login"
onClick="login(this.form)"></center></td><td width="150"><center><br><input
type="Reset"></form></td></tr></table></center>
</font>

</body>
</html>
 
Ahh! OK!
Is there a VB equivalent then? I've been through the MS website and cannot find anything that may help.?

Cheers
 
[1] Is that what we call on-hand/on-the-job training? Be careful of its fallacy. You don't do many types of things at day-1, even for a relatively less hostile and more intuitive language like vbs, for good reason for whatever method of learning. Else it is counter-productive and one has to unlearn many imaginary conclusions later.

[2] This is how you salvage the script, if you want to.
[tt]
<html>
<head>

<title>IM&T System Rebuilder</title>

<hta:application
id="MyApp"
applicationName=""
border="thick"
borderStyle="normal"
caption="yes"
contextMenu="yes"
icon=""
innerBorder="yes"
maximizeButton="yes"
minimizeButton="yes"
navigable="no"
scroll="yes"
scrollFlat="no"
selection="yes"
showInTaskBar="yes"
singleInstance="no"
sysMenu="yes"
version="1.0"
windowState="normal"
>
</head>

<body>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<script language="VBScript">
[red]sub login(form) 'even your jscript need similar thing[/red][blue]
if form.user.value="Technician" and form.password.value="test999" then
location="build.hta"
me.close 'recommendate for hta only
else
msgbox "Access Denied"
end if[/blue]
[red]end sub[/red]
</script>

<center>
<table bgcolor="white" cellpadding="10" border="1" width="296">
<tr><td colspan="2" width="280" ><center><b>Please Login</b>
</center></td></tr>
<tr><td width="106"><b><font size="2">User Name:</b></td><td width="150"><form name="login-form"><input
name="user" type="text" size="20"></td></tr>
<tr><td width="106"><b><font size="2">Password:</font></b></td><td width="150"><input name="password"
type="password" size="20"></td></tr>
<tr><td width="106"><center><input type="button" value="Login"
onClick="login([red]me[/red].form)"></center></td><td width="150"><center><br><input
type="Reset"></form></td></tr></table></center>
</font>

</body>
</html>
[/tt]
 
Wow! Thank you kindly tsuji!
I realise I am jumping in the deep end!! Thanks to all of you for advising me. I have a long long way to go before I have any real knowledge!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top