Click to See Complete Forum and Search --> : javascript code....
gazanime
03-23-2005, 06:40 PM
:confused: I have a website on freewebs.com and i typed in a password asking javascript code and it will not pop up. heres the code::
<HEAD><SCRIPT language="JavaScript"><!--hidevar password;var pass1="bump";password=prompt('wait!I need the password...',' ');if (password==pass1)alert('Welcome back');else { window.location="http://www.freewebs.com/gazanime/joinnow.htm";}//--></SCRIPT></HEAD>
MstrBob
03-23-2005, 06:59 PM
Password protection with Javascript is a joke. Even young kids on the internet know how to view the source of a page and find the password. Don't even try.
phpnovice
03-23-2005, 07:00 PM
You can't put that all on one line. Format that this way:
<HEAD>
<SCRIPT language="JavaScript">
<!--//
var pass1="bump";
var password=prompt('wait!I need the password...',' ');
if (password==pass1) alert('Welcome back');
else window.location="http://www.freewebs.com/gazanime/joinnow.htm";
//-->
</SCRIPT>
</HEAD>
gazanime
03-23-2005, 07:01 PM
Originally posted by MstrBob
Password protection with Javascript is a joke. Even young kids on the internet know how to view the source of a page and find the password. Don't even try.
well i dont want to pay to just have my page password protected.besides i need it in html code
phpnovice
03-23-2005, 07:02 PM
See my answer above.
gazanime
03-23-2005, 07:03 PM
Originally posted by phpnovice
See my answer above.
yes i do and thank you ill try it out now...
MstrBob
03-23-2005, 07:04 PM
Alright, you don't have to pay to have a password protected page, but whatever. Just remember that it's about as secure as leaving your front door open.
gazanime
03-23-2005, 07:07 PM
Originally posted by MstrBob
Alright, you don't have to pay to have a password protected page, but whatever. Just remember that it's about as secure as leaving your front door open.
but on freewebs.com you do have to pay to have a password protected page
gazanime
03-23-2005, 07:08 PM
thank you very much phpnovice. now it is working.
phpnovice
03-23-2005, 10:58 PM
Cheers.
the tree
03-24-2005, 02:03 AM
Originally posted by gazanime
but on freewebs.com you do have to pay to have a password protected page If you want a secure page then there are about a gazzlion other free hosts.
Incedently, JS passwords are slightly more secure than leaving your front door open, they're more like replacing your lock with a note saying "please don't break in, thankyou"
MstrBob
03-24-2005, 10:35 AM
Originally posted by the tree
If you want a secure page then there are about a gazzlion other free hosts.
Incedently, JS passwords are slightly more secure than leaving your front door open, they're more like replacing your lock with a note saying "please don't break in, thankyou"
I'd say it's more like closing your door, and hoping no one will realize that you've left the key under the doormat. Many free hosts out there support server side languages, which is what you want. You can very easily set up a simple password protection that will be much more secure then Javascript. Don't get me wrong, I've seen some Javascript protection which is hard to break, but that's getting very complex. And what if they have Javascript disabled, as some surfers choose to do?