Hallo
Ich habe ein Problem.
Hier ist mein Loginscript:
<?php
session_start();
include "mysql_connectinfo.php";
if (isset($_SESSION['angemeldet']) $_SESSION['angemeldet']) {
header('Location: login-index.php');
exit;
}
else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'];
$passwort = $_POST['passwort'];
$sql = mysql_query("SELECT $mysqlname FROM $mysqltable WHERE $mysqlname='$username' AND $mysqlpwd='$passwort'");
$num = mysql_num_rows($sql);
if ($num != 0) {
$_SESSION['angemeldet'] = true;
?>
?>
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {
if (php_sapi_name() == 'cgi') {
header('Status: 303 See Other');
}
else {
header('HTTP/1.1 303 See Other');
}
}
header('Location: login-index.php');
exit;
}
else {
echo "<p><b>Falsche Login-Daten!!</b></p>";
}
}
?>
<form action="login.php" method="post">
<table border="0">
Login
<tr>
<td>Username:</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" name="passwort" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Einloggen" /></td>
</tr>
</table>
</form>
<a href="admin-login.php">Admin Login</a></br>
<a href="eintragen.html">Registrieren</a>
So. Als Fehler bekomme ich unexpected $end. Was soll ich ändern?