Es kommt folgende Warnung Loginseite: Es funktioniert in Localhost, aber nicht in Remote-Host
Warnung: session_start() [function.session-start]: Session-Cookie kann nicht gesendet werden – Header bereits gesendet von (Ausgabe ab Zeile 8 gestartet)
Warnung: session_start() [function.session-start]: Session-Cache-Limiter kann nicht gesendet werden – Header bereits gesendet (Ausgabe begann in Zeile 8)
index.php
<?php
session_start();
if(isset($_SESSION['usr']) && isset($_SESSION['pswd'])){
header('Location: content.php');}
?>
<body>
<center>
<form method='post' action='login.php'>
<!– in this example I link it with login.php to check the password & username–>
<table>
<tr><td>Username:</td><td><input type="text" name="usr"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pswd"></td>
</tr>
<tr><td><input type="submit" name="login" value="Login"></td>
<td><input type="reset" name="reset" value="Reset"></td></tr>
</table>
</form>
</center>
</body>
content.php
<body>
<a href="https://stackoverflow.com/questions/21521768/resumedownload.php">Click here to Download to Resume</a>
<?php
session_start();
if(!isset($_SESSION["usr"]) || !isset($_SESSION["pswd"])){
header('Location: index.php');}
include 'logoff.php';
?>
</body>
login.php
<body>
<?php
session_start();
if($_REQUEST['usr']=='suman.trytek' && $_REQUEST['pswd']=='solutions'){
$_SESSION['usr'] = 'suman.trytek';
$_SESSION['pswd'] = 'solutions';
header('Location: content.php');
}
else{
header('Location: index.php');
}
?>
</body>
Hier finden Sie die Antwort: stackoverflow.com/questions/8028957/…
– Mario Radomanana
3. Februar 2014 um 7:22 Uhr
Es liegt an mehreren gesendeten Header-Positionen, sodass Sie oben nach
– Vikas Gautam
3. Februar 2014 um 7:25 Uhr
In meinem Fall musste ich die Dateikodierung ohne BOM einstellen.
– Wessam El Mahdy
6. Mai 2016 um 5:55 Uhr