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

Vb Script Query (Website)

Status
Not open for further replies.

ppretorius

Technical User
Mar 25, 2004
20
0
0
ZA
Hi,

Im interested in modifying some code i came about. Its a simple way out concering security for a site. I admit, if theres some1 on the receiving side thats smart enough, they could read the code and enter the site.

I personally dont know vb at all. I would really appreciate if some1 could assist me in making it do something.

Heres the Code:

sub enterbtn_onclick
if userbox.value="User" and pswbox.value="123Password" then
msgbox"Thank You"
else msgbox"Sorry Incorrect Username or Password entered"
end if

end sub

Now my questions.
* Can we modify the script to be able to add more users (by saying "or" maybe??)
* Is it possible to make the script open a page after the Thankyou msg ???

If some1 could edit it or tell me how, i'd be supper gr8ful!!

Thnx
 
I find it interesting, i will do more research on it - Thank you Mark.

But it still hasnt answered the 2 questions i innitially posed ?? *cry*
 
You don't say anthing about where you would implement the above code so I don't want to comment. If you are using ASP, a visitor will not be able to see that information.

I hope you find this post helpful.

Regards,

Mark
 

NO NEED TO COMMENT AS YOU HAVE JUST DONE IT INDIRECTLY - THNX

i plan to implement it on a LAN thats part of a MASSIVE WAN thats Behind a couple f/w.

You see ... I travel from office to office on a daily bases

i plan to setup an apache server on my local machine with links to pages that i use to administer each office.

If i setup a simple page that my users wont be able to access, that has links to all my commonly browsed, it doesnt matter in which office im in ... The links are all there (behind a logon page of course) No more having to remember ip's ect. Even if they (users) do manage to get past the logon page, they will be asked passwords etc if they try to manage a switch for instance, or if they try to approve updates for SUSAdmin etc.

The site wont be published on our intranet so no-one will even know it exists ... I require simple security.

If you can make my Vb Script redirect me to another page after i click ENTER ... I'll jump for joy!!!

Thnx
 
The code you need is:

if userbox.value="User" and pswbox.value="123Password" then
msgbox"Thank You"

ELSEIF userbox.value="User" and pswbox.value="123Password" then

else msgbox"Sorry Incorrect Username or Password entered"
end if

for the redirect, In asp it would be "Response.Redirect("PAGE NAME")", what language is it running in?
 
I was unsure as there are so many lanuages ... I just pasted it from the html ... Is this what ya need to know ??

<script language="VBScript">

sub enterbtn_onclick
if userbox.value="User" and pswbox.value="123Password" then
msgbox"Thank You"
else msgbox"Sorry Incorrect Username or Password entered"
end if

end sub


I dont know VB but i basically want it to function like this (Expcept this doesnt work) I've added the "then etc" after "Thank You" :

<script language="VBScript">

sub enterbtn_onclick
if userbox.value="User" and pswbox.value="123Password" then
msgbox"Thank You" then
open "else msgbox"Sorry Incorrect Username or Password entered"
end if

end sub
 
If everything is just client-side, in particular accept username and password client-side against some data scripted into the page, then there would be no submission to client. If this is the case, then you can do this.
[tt]
sub enterbtn_onclick

if userbox.value="User" and pswbox.value="123Password" then
msgbox[COLOR=red yellow] [/color]"Thank You" then
window.open " else
msgbox[COLOR=red yellow] [/color]"Sorry Incorrect Username or Password entered"
end if

end sub
[/tt]
This will open a new window. If you want to keep the same browser window, just "redirected" to that location, it is this.
[tt]sub enterbtn_onclick
if userbox.value="User" and pswbox.value="123Password" then
msgbox[COLOR=red yellow] [/color]"Thank You"
window.location=" else
msgbox[COLOR=red yellow] [/color]"Sorry Incorrect Username or Password entered"
end if

end sub
[/tt]
 
YOU ARE THE BEST TSUJI

Thank you THANK YOU SO SO MUCH!!

I REALLY APPRECIATE YOUR ASSISTANCE

ILL GIVE IT A BASH - WILL POST THE RESULTS

TAKE CARE GUYS - THNX AGAIN

 
Just tested the script ... Worx 100%

Thnx to all who assisted

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top