kleines prob

Status
Nicht offen für weitere Antworten.

minotaurus

Neues Mitglied
Was muss ich an dem Quelltext ändern, damit wenn ich das richtige pw eingebe zb. auf die seite text.html komme
und beimn falschen pw auf die seite zb. testt.htm
P.s.: bin totaler java und java script anfänger bitte um hilfe.
Code:
<html> 
<head> 
 

 
<div align="center"><html> 
<head> 
<title>Interner Bereich</title> 
<meta name="" content=""> 
<meta name="" content=""> 
</head> 
<body background=yellow bgproperties=fixed 
text="#000000" bgcolor="#ffffff" link="#000000" alink="#000000" vlink="#0000FF"> 
<font size="+4"><font color="#ffffff"></font></font>
 
<script language="JavaScript"> 
<!-- 
function checkPassword() { 
if( document.pwort.pw.value != "" && document.pwort.pw.value != null) 
window.location=document.pwort.pw.value + ".htm"; 
} 
//--> 
</script> 
<h3>Bitte Kennwort eingeben</h3> 
<form name=pwort> 
Passwort eingeben: 
<input type="PASSWORD" name="pw" size="8" maxlength="8"> 
<input type="button" value="OK" onClick="checkPassword()"> 
</form> 
</body> 
</html>
 
B

bygones

Gast
also ich hoffe mal dass das nur ein Test ist - denn einen passwortschutz mit JavaScript ist alles andere als sicher.

eine möglichkeit:
Code:
<html><head><title>Test</title>
<script type="text/javascript">
<!--
function check() {
if(document.hallo.passwd.value == "Hallo") window.location.href="http://www.google.de";
else window.location.href="http://www.google.com";
}
//-->
</script>
</head><body>
<form name="hallo">
<input type="text" name="passwd">
<input type="button" value="Los" onClick="check()">
</body></html>
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben