tag
hab da n login gebastelt:
es kommt ein parse error in der letzten linie was ist falsch??
danke
hab da n login gebastelt:
PHP-Code:
<?
session_start ();
echo"<!doctype html public \"-//W3C//DTD HTML 4.0 //EN\"> ";
echo"<html> ";
echo"<head> ";
echo"<title>Tab</title> ";
echo"<meta name=\"author\" content=\"Manuel\"> ";
echo"<meta name=\"generator\" content=\"Ulli Meybohms HTML EDITOR\"> ";
echo"<link rel=\"stylesheet\" href=\"./dateien/css.css\" type=\"text/css\"> ";
echo"</head> ";
echo"<body> ";
include ("./dateien/inc/menuoben.php");
echo"<center><div class=\"bold\">[<code class=\"old\">login</code>]</div></center> ";
if(!isset($_POST['submit'])) {
echo "<form action=\"";
$PHP_SELF;
echo "\" method=\"post\" name=\"form\">";
echo"<code>Username:</code> <br> ";
echo"<input type=\"text\" class=\"input\" size=\"50\" maxlength=\"50\" ";
echo"name=\"username\"><br> <br><hr style=\"border: 1px solid #4F4F4F\"><br>";
echo"<code>Password:</code><br> ";
echo"<input type=\"password\" class=\"input\" size=\"50\" maxlength=\"50\" ";
echo"name=\"password\"><br> <br><hr style=\"border: 1px solid #4F4F4F\"><br> ";
echo"<center><input type=\"submit\" name=\"submit\" value=\">> login >>\" class=\"button\"> ";
echo"</center> ";
echo"</form> ";
}elseif(!$_POST['username'] || $_POST['username'] == "" || !$_POST['password'] || $_POST['password'] == "") {
echo" <blink>bitte alles ausfüllen</blink>";
echo "<form action=\"";
$PHP_SELF;
echo "\" method=\"post\" name=\"form\">";
echo"<code>Username:</code> <br> ";
echo"<input type=\"text\" class=\"input\" size=\"50\" maxlength=\"50\" ";
echo"name=\"username\"><br> <br><hr style=\"border: 1px solid #4F4F4F\"><br>";
echo"<code>Password:</code><br> ";
echo"<input type=\"password\" class=\"input\" size=\"50\" maxlength=\"50\" ";
echo"name=\"password\"><br> <br><hr style=\"border: 1px solid #4F4F4F\"><br> ";
echo"<center><input type=\"submit\" name=\"submit\" value=\">> login >>\" class=\"button\"> ";
echo"</center> ";
echo"</form> ";
}else{
include("./dateien/inc/connection.php");
// Datenbankverbindung aufbauen
$user = $_POST['username'];
$md5 = md5($_POST['password']);
$abfrage = "SELECT * FROM users WHERE user = '".$user."' AND passwordmd5 = '".$md5."'";
$ergebnis = mysql_query ($abfrage);
if (mysql_num_rows ($ergebnis) > 0)
{
// Benutzerdaten in ein Array auslesen.
$row = mysql_fetch_array ($ergebnis);
// Sessionvariablen erstellen und registrieren
$_SESSION["user"] = $row["user"];
header ("Location: profil.php");
}
else
{
header ("Location: loginfail.php");
}
include("./dateien/inc/menuunten.php");
echo"</body>";
echo"</html>"; ?>
danke
Kommentar