Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 10-16-2005, 03:48 PM   #1
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default help with VB script

Hi,
Im making a website with a password login thingy, heres the code I've got so far:

Code:
Sub Button1_onclick
	if  = "password" then msgbox "hello"
	else msgbox "get it right"
End Sub


I want it to retrieve the text that has been put into the password text box and make this a "pass" variable. Hopefully I could then use the if... statement (as you see above) to see if the correct password has been entered).Any ideas how to do this.

I would also like it to go to a specific web address if the password is correct

thanks in advance
__________________

__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 10-16-2005, 06:06 PM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: help with VB script

VBscript is a very bad way of making passwird protected websites.

there are also other problems,

1, some web browsers don't understand VB script, (some refuse to use VB script as this is a microsoft technology, (this includes all Linux Users).

2, VB script is unsecure. you'll have to declare the password in the script to have it checked, the password will have to be in plain text somewhere in the document, OR, you'll have to work out sme sort of encrpytion, but it's going to have to be declared in the script, and reversible throughout the script.

You'd be much beter advised to use Java, (not javascript), ASP, PHP, PERL or some other web language,
Have a think about what I've said, and I'll help you with whatever you'd like to use as the final solution.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is online now   Reply With Quote
Old 10-18-2005, 04:29 PM   #3
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: help with VB script

ok, thanks for that, I'll take you up on that, would you know how to do this in Java, it's easier for me to use VBscript, as I already know VB and the two are very similar. However, I dont have the time to learn Java just for 1 site, could anyone help me with coding it in java.
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 10-19-2005, 07:12 PM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: help with VB script

Writing in javascript is just as bad for this...

consider this code sample

Code:
<html>
<script>
var password="asecret";
function checkpassword()
{
 var pass=document.logon.passbox.value;
 if (pass == password)
 {
  document.location = "www.enter.com";
 }
 else
 {
  document.location = "www.deny.com";
 }
}
</script>
<form name=logon>
<input type="text" name="passbox" />
<img src="submit.gif" onclick="checkpassword();">
</form>
</html>
That Javascript does exactly what you want, but it's still just as insecure as if you did it in VB script...

The best route is still PHP/ASP

if you already nkow VB script, then I suggest ASP will have an easier learning curve as it's vaguely simillar in a lot of respects... the biggest difference of course is that unless something has a print to page type statement before it it cannot be seen, thus making your password secure...
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is online now   Reply With Quote
Old 10-21-2005, 04:57 PM   #5
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: help with VB script

thats great, except one thing, I need a username thing as well, rather like the one that we have on CF, but with only like 5 usernames and their different passwords, there is no real need for a database, as there will be few members (less than 5) so it could be contained within the code: could anyone help me with that.

I wouldnt bother about security, its only so people can see a few pictures (its for a photography website I'm designing for my dad)
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 10-21-2005, 09:03 PM   #6
Solid State Member
 
Join Date: Oct 2005
Posts: 9
Default Re: help with VB script

I would strongly recommend php for this application. I'm sure there are people in this forum that are willing to help you code it.
jetway is offline   Reply With Quote
Old 10-22-2005, 07:03 AM   #7
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: help with VB script

oh, ok, I dont care what language its in, but can anyone help me code this. Many thanks in advance, it is really important I get this done
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 10-22-2005, 03:05 PM   #8
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: help with VB script

Do you know what webserver you have and whether you are allowde to set up protected areas?

That wuold most likely be the best solution to the poblem here, both secure, and working with minimum effort...
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is online now   Reply With Quote
Old 10-22-2005, 03:29 PM   #9
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: help with VB script

at present my host is www.1asphost.com its the free account. I will soon be upgrading to another host, as I need hosting without popups and messages (i'm using that one merely to test the site as it may take me some time to complete the site) the truth is: I dont know. I wouldnt have thought so.

As I have said before, it doesnt need to be that secure, as it is for a photography website, allowing clients to log in and see their photos before ordering, I'm sure that hackers aren't that bothered about seeing a few photos, there isnt any personal information that they can know from that.

My only problem with the code you origionally gave me is that I need to have several usernames as well, it was great, I have used that code, but would like to have usernames as well
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 10-24-2005, 03:58 PM   #10
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: help with VB script

please, anyone, I REALLY need some help with this
__________________

__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Reply

« Frames | php »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:06 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0