Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
function verify(){
checkname = document.pass.passname.value
checkpass = document.pass.password.value
fullpass = checkname + " " + checkpass
marker = false
users = 3 //Anzahl der Benutzer i.B. 3
userlist = new Array
userlist[0] = "Name1 Passwort1"
userlist[1] = "Name2 Passwort2"
userlist[2] = "Name3 Passwort3"
for (i = 0; i < users; i++){
if (fullpass == userlist[i]){
opener.location = "IhreGeheimseite.html"
marker = true
}
}
if (marker == true){
window.close()
}
else {
alert("Sie haben einen Falschen Namen angegeben, bitte wiederholen Sie die Eingabe!")
}
}
<html>
<head>
<title>Passwortschutz - mehrere Benutzer</title>
<!--Metas und son zeug-->
</head>
<body>
<?php
$zugang = Array();
/****Notiere Hier die Benutzer**********************************/
/****Notiere sie in der Form Benutzername|Passwort**************/
/****Es darf kein | zeichen im Benutzername oder Passwort sein!*/
$zugang[] = "Admin1|Passwort1";
$zugang[] = "Paul|rot";
$zugang[] = "Mustermann|1234567890";
/***************************************************************/
if($_POST['send'] == null || $_POST['send'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr>
<td colspan="2">Passwort geschützter Bereich</td>
</tr>
<tr>
<td>Benutzername:</td>
<td><input type="text" name="user"></input></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" name="pw"></input></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="send" value="einloggen"></input></td>
</tr>
</table>
</form>
<?php
}
else
{
$login = false;
foreach($zugang as $benutzer)
{
$benutzer = preg_split('/\|/',$benutzer);
if($_POST['user'] == $benutzer[0] && $_POST['pw'] == $benutzer[1])
{
$login = true;
}
}
if($login == true)
{
?>
Hier ist dein geschützer Inhalt!!!!
<?php
}
else
{
echo"Dein Benutzername / Passwort war falsch!<br>";
echo"<a href=\"".$_SERVER['PHP_SELF']."\">zurück!</a>";
}
}
?>
</body>
</html>