Moin,
dieser Fehler kommt bei meinem Login Script:
Warning: Cannot modify header information - headers already sent by (output started at D:\Programme\xampp\htdocs\Server\news-script(2)\news-script\login.php:17) in D:\Programme\xampp\htdocs\Server\news-script(2)\news-script\login.php on line 45
wisst ihr woran das liegt?
dieser Fehler kommt bei meinem Login Script:
Warning: Cannot modify header information - headers already sent by (output started at D:\Programme\xampp\htdocs\Server\news-script(2)\news-script\login.php:17) in D:\Programme\xampp\htdocs\Server\news-script(2)\news-script\login.php on line 45
wisst ihr woran das liegt?
PHP:
<?php
session_start('user');
include("config.php");
?>
<html>
<head>
<title>Login</title>
</head>
<body>
<form method="post">
Name: <input type="text" name="name" value="" id="name"><br>
Passwort: <input type="password" name="pw" value="" id="pw"><br>
<input type="submit" name="login" value="Login" id="login"><br>
</form>
<?php
if(isset($_POST['login'])){
$name = $_POST['name'];
$pw = $_POST['pw'];
$pw = md5($pw);
if($name == "" or $pw == ""){
echo "Nicht alle Felder ausgefüllt";
exit;
}
$select = "SELECT * FROM user WHERE user = '$name'";
$query = mysql_query($select);
$fetch = mysql_fetch_assoc($query);
if(!isset($fetch)){
echo "Dieser Benutzer existiert nicht";
exit;
}
if($fetch['pw'] != $pw){
echo "Das Passwort ist falsch";
exit;
}
$_SESSION['user'] = '$name';
header("Location: index.php");
}
?>
</body>
</html>