Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I just purchased www.matt-hawk.com and im using it for file sharing with friends and stuff, so i made a login page from dynamic drive javascripts.
It makes it so users have to use, username: member and password : mhnet, and here is the script:function authUser(form) {
if (form.Username.value=="member") {
if (form.Password.value=="mhnet") {
location="../index.htm"
} else {
location="UnAuthorized.htm"
}
} else {
location="UnAuthorized.htm"
}
}I know C++ so im pretty used to programming and i was wondering if there was a way that I could add more than one account, maybe like this:
function authUser(form) {
if (form.Username.value=="member") {
if (form.Password.value=="mhnet") {
location="../index.htm"
if (form.Username.value=="newuser") {
if (form.Password.value=="password") {
location="../index.htm"
} else {
location="UnAuthorized.htm"
}
} else {
location="UnAuthorized.htm"
}
}Would that work?
thanks,
matt

Using javascript will keep out only the people that you don't need to worry about, those too inexperienced to cause any problems and those not inclined to cause you problems.
The reason is that you can't stop someone from seeing your JavaScript code. You can make it a little bit difficult, but that will just give some people more reason to try to get in.
If you can program in C++, you can figure out a server side way to handle the passwords.
The easiest way would probably be to use PHP. You can probably find PHP examples of how to do this.
You can also use C++ to do CGI programming but that will take more learning.

On your About Us page you talk about Matt Hawk Net, but your URL is matt-hawk.com.
I'd suggest going to godaddy.com or some similar cheap domain name registrar and getting matt-hawk.net. It's available. You can get it at godaddy.com for $8.95/year.
Just my 2cents.

do you know where a good place is for user authinication for websites in PHP are?
thanks for your help,
matt

Yeah, definitely go with PHP. It was blatantly easy to discover the username and password, which were both also plain text. :(

Or you could use this in your javascript:
location.href=form.Password.value
Just rename a page to the password, be sure to turn off directory listing, and don't allow search engines to index it (meta tags).

bored
Good suggestion. I'd forgot about that option. I've never used it, but it's the only client side option I've seen that has any sort of security.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |