100% agree
Dann geht es so:
<?php
$host="<host>";
$user="<user>";
$passwort="<passwort>";
$datenbank="<datenbank>";
$verbindung=@mysql_connect($host,$user,$passwort) OR die ("Unable to connect to " . $host . " - Please try again later");
mysql_select_db("$datenbank");
if($submit)
{
$sql="SELECT passwort FROM users WHERE id='$uid'";
$ergebnis=mysql_query($sql,$verbindung);
$daten=mysql_fetch_array($ergebnis);
if($daten[passwort]==$pw)
{
echo "Login successfully";
}
else
{
echo "Wrong Password";
}
}
else
{
$sql="SELECT id,user FROM users";
$ergebnis=mysql_query($sql,$verbindung);
echo "<h2>Login:</h2>";
echo "<form action="" . $PHP_SELF . "" method="POST">";
echo "<table>";
echo "<tr><td>Ihr Loginname:</td><td>";
echo "<select name="uid" size="1">";
while($daten=mysql_fetch_array($ergebnis))
{
echo "<option value="$daten[id]">$daten[user]";
}
echo "</select>";
echo "</td></tr>";
echo "<tr><td>Ihr Passwort:</td><td><input type="password" name="pw"></td></tr>";
}
?>