Hallo
Schon wieder Probleme mit dem Login
Script:
<?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;
?>
<?php
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {
if (php_sapi_name() == 'cgi') {
header('Status: 303 See Other');
}
else {
Fail;
}
}
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>
Fehler:Warning: Cannot modify header information - headers already sent by (output started at /data/multiserv/users/952248/projects/2184295/www/login.php:25) in /data/multiserv/users/952248/projects/2184295/www/login.php on line 35
Ich hab keine Ahnung wie ich das mit nur einem Header mache. Bitte helft mir!
Danke!