Click to See Complete Forum and Search --> : add username/password


smartguybot576
11-02-2003, 09:16 PM
i already have a javascript with a password function. is there a way i can have a user enter a username and password, and it automaticly be added to the js document?:confused: :confused:

pyro
11-02-2003, 09:28 PM
You might want to reconsider using JavaScript for password protection. It is not the best language available for such things. A server side language such as PHP or Perl is much better suited for this.

smartguybot576
11-02-2003, 09:31 PM
i dont need extream password protection....java script is fine for me

pyro
11-02-2003, 09:34 PM
Ok, then post your code and we perhaps we can give you more input.

smartguybot576
11-02-2003, 09:36 PM
Heres the script


<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="admin" && password=="pass") { window.location="bolt.html"; done=1; }
if (username=="member2" && password=="password2") { window.location="bolt.html"; done=1; }
if (username=="member3" && password=="password3") { window.location="bolt.html"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
// End -->

smartguybot576
11-03-2003, 02:57 PM
is it even possible? could someone even give me a vauge idea here? please dont leave me hanging?!

pyro
11-03-2003, 03:41 PM
If you want it automatically entered (ie, no processing on your part) you will need to use some sort of server-side language, such as PHP or Perl.

smartguybot576
11-03-2003, 04:03 PM
i am using a free geocities account to host my web page, and dont think i can
is there a way 2 do it w. javascript

pyro
11-03-2003, 04:32 PM
No, JavaScript does not have file writing capability.