ich möchte gerne ein Script mit Login haben, soweit so gut login.php ist auch schnell geschrieben. auch die Admin.php steht.
Leider kann ich mich nicht einloggen. Nur ich habe keinen Schimmer warum?
Hier der Quelltext, evt. sehe ich den Wald vor lauter Bäumen nicht?!?
login.php
Code: Alles auswählen
<?php
if (isset($_POST["gesendet"])){
include ("config.php");
if ($e1 == $s_username && $e2== $s_passwd){
session_register("s_username", "s_passwd");
Header("Location: admin.php?".SID."");
exit;
}
else {
print "Sie haben keinen Zugriff auf diese Seite !
<p><img src=\"aetsch.gif\" width=\"66\" height=\"46\" border=\"0\" />";
}
}
?>
<html>
<head>
</head>
<body>
<p>
Bitte geben Sie Benutzernamen und Kennwort ein !
<form action="<?php $_SERVER["PHP_SELF"] ?>" method="post">
<input name="e1">Username<br>
<input type="password" name="e2">Passwort<br>
<input type="submit" value="Absenden" name="gesendet">
</form>
</body>
</html>
Code: Alles auswählen
<?php
session_start();
if(!isset($_SESSION["s_username"])){
header("Location: login.php");
}
print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body>
<table width="65%" border="1" align="center" cellpadding="4" cellspacing="0">
<form action="eintrag.php?<?php print "".SID; ?>" method="post" enctype="application/x-www-form-urlencoded" name="form1">
<tr align="center">
<td colspan="2"><a href="change.php?<?php print "".SID; ?>">Datensätze
bearbeiten/löschen</a></td>
</tr>
<tr>
<td width="38%"><select name="selection0" onChange="location.href='admin.php?<?php print SID."&cat=" ?>'+this[this.selectedIndex].value">
<?php if(isset($cat)) { $test = $cat; } else { $test = "Bitte auswählen"; } ?>
<option value="<?php print $test; ?>" selected="selected"><?php print $test; ?></option>
<?php include("functions.php"); showcat('art', 'prod'); ?>
</select>
<br />
<br />
<input name="art_neu" type="text" id="art_neu" size="30" />
<br />
</td>
<td width="62%">Geräteart auswählen oder neue hinzufügen</td>
</tr>
<tr>
<td>
<select name="selection1" onChange="location.href='admin.php?<?php print SID."&cat=$cat&key="; ?>'+this[this.selectedIndex].value">
<?php if(isset($key)) { $test1 = $key; } else { $test1 = "Bitte auswählen"; } ?>
<option value="<?php print $test1; ?>" selected="selected"><?php print $test1; ?></option>
<?php
include("config.php");
$link = mysql_connect($hostname, $benutzer, $passwort);
if(!$link) {
die("<strong>Kann den Server nicht erreichen.</strong>");
}else{
mysql_select_db($db) or die ("<strong>Konnte Datenbank nicht öffnen: </strong>".mysql_error() );
}
$res = mysql_db_query($db, "select distinct hersteller from prod where art = '$cat' ");
while($row = mysql_fetch_array($res)) {
print "<option value=\"".$row["hersteller"]."\">".$row["hersteller"]."</option>";
}
mysql_close($link);
?>
</select>
<br />
<br />
<input name="her_neu" type="text" id="her_neu" size="30" />
</td>
<td>Hersteller auswählen oder neu eingeben</td>
</tr>
<tr>
<td> <br />
<input name="mod" type="text" id="mod" size="30" />
</td>
<td>Modell eingeben</td>
</tr>
<tr>
<td><textarea name="bau_mod" cols="40" rows="8" id="bau_mod"></textarea>
</td>
<td>Baugleiche/ähnliche Modelle</td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="eintrag" id="eins" value="Abschicken" />
<input type="reset" name="reset" value="Zurücksetzen" />
</td>
</tr>
</form>
</table>
<p>
</body>
</html>