Ein Bekannter kommt nicht mehr in seinen Admin Bereich.
Die index.html im admin-Bereich ist folgendermaßen:
Jetzt gehe ich davon aus das beim druck auf den login Button die login.php ausgeführt wird:
Welche Bedingung muß denn jetzt erfüllt sein damit ich in den Admin bereich komme?
In der Datenbank sind 2 User eingetragen, aber mit deren namen und passwort werde ich immer wieder auf die index.html geschickt!
Ich hoffe mir kann hier jemand helfen.
Danke
Frank[/code]
Die index.html im admin-Bereich ist folgendermaßen:
Code:
<html>
<head>
<title>Administration-BackEnd</title>
</head>
<link rel="stylesheet" type="text/css" href="../layout/css.css">
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<table border="0" cellpadding="5" cellspacing="0" width="450" height="400" class="tabbody">
<tr>
<td align="center" valign="middle" class="tab1">
<h2>Administration</h2>
</td>
</tr>
<tr>
<td align="center" class="tab2">
<form name="login" action="login.php" method="post">
<table border="0" cellpadding="3" cellspacing="0" class="tabbody">
<tr>
<td class="tab2">
Username:
</td>
<td class="tab2">
<input type="text" name="username" class="textfield" size="20">
</td>
</tr>
<tr>
<td class="tab2">
Password:
</td>
<td class="tab2">
<input type="password" name="pass" class="textfield" size="20">
</td>
</tr>
<tr>
<td colspan="2" class="tab2">
<input type="Submit" value="login">
</td>
</tr>
</table>
</form>
Hinweis: Schlägt der Login fehl, werden Sie auf diese Seite zurückgeleitet.
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Code:
<?PHP
include("../inc/database.class.php");
include("../inc/config.inc.php");
include("../inc/functions.inc.php");
$db = new database($_CONF['host'],$_CONF['user'],$_CONF['pass'],$_CONF['dbname']);
$db->query("SELECT * FROM users WHERE user_name = '".$_POST['username']."' AND user_password = PASSWORD('".$_POST['pass']."')");
$row = $db->fetch();
if($db->numRows() == 0) {
$db->close();
header("location: index.html");
} else {
$sid = GenerateSessionID();
$db->query("INSERT INTO user_online (type, session_id, lastactive) VALUES ('".$row['user_type']."', '".$sid."', '".time()."')");
$db->close();
header("location: main.php?sid=".$sid."");
}
?>
In der Datenbank sind 2 User eingetragen, aber mit deren namen und passwort werde ich immer wieder auf die index.html geschickt!
Ich hoffe mir kann hier jemand helfen.
Danke
Frank[/code]

Kommentar