Session Fehler :-(
Christopher
- php
0 wahsaga0 Christopher0 Andreas Görtz0 Christopher0 Tom
Grüß euch,
folgender fehler kommt wenn ich admin1.php aufrufen will:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /opt/lampp/htdocs/speedcore/admin1.php:1) in /opt/lampp/htdocs/speedcore/admin1.php on line 1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /opt/lampp/htdocs/speedcore/admin1.php:1) in /opt/lampp/htdocs/speedcore/admin1.php on line 1
Was kann das bedeuten in admin1.php ist folgender inhalt:
<?php session_start (); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0 Transitional//EN"> <html> <head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>xx.at BOOKING | PARTY | PICS | COMMUNITY == EXTREME MUSIC FOR EXTREME PEOPLE ==</title>
<meta http-equiv="pragma" content="no-cache"> <meta name="revisit-after" content="7"> <meta http-equiv="expires" content="0"> <meta name="robots" content="index, follow">
<link rel="stylesheet" href="config/core.css" type="text/css" >
<script type="text/javascript" src="config/js.php"></script>
</head> <html>
<head>
<style> <!-- .menu {text-decoration:none;font-family:Verdana,Arial;font-size:11px;color:#333333;text-align:justify;}a.menu {text-decoration:none;font-family:Verdana,Arial;font-size:11px;color:#000000}a:link.menu {text-decoration:none;color:#000000}--> </style> </head>
<body>
<div id="menu" style="Z-INDEX: 100; LEFT: 0px; POSITION: absolute; TOP: -250px"> <table style="BORDER-RIGHT: #000000 1px outset; BORDER-TOP: #000000 1px outset; BORDER-LEFT: #000000 1px outset; BORDER-BOTTOM: #000000 1px outset" height="181" cellSpacing="0" cellPadding="3" width="142" background="pic/context.jpg"> <tr> <td class="menu" vAlign="top"> <a class="menu" onfocus="if(this.blur)this.blur()" href="javascript:history.back()"> <img alt="Zurück" src="pic/back.gif" border="0" width="20" height="20"></a> <a class="menu" onfocus="if(this.blur)this.blur()" href="javascript:history.forward()"> <img alt="Vorwärts" src="pic/forw.gif" border="0" width="20" height="20"></a> <br> <br> <b>Hinweis::</b><br> Alle Bilder unterliegen dem Copyright und dürfen nur für private Zwecke kopiert und genutzt werden!<br> <br> © xx.at</td> </tr> </table> </div> <script src="config/clock.js" type="text/javascript"> </script> <center> <table height="10" cellSpacing="2" cellPadding="0" border="0"> <tr> <td vAlign="top"> <table height="100%" cellSpacing="0" cellPadding="0" border="0"> <tr> <td height="20"> <img alt="www.xx.at" src="pic/leer1.jpg" width="20" height="22"></td> </tr> <tr> <td> <table height="100%" cellSpacing="1" cellPadding="0" bgColor="#000000" border="0"> <tr> <td vAlign="top" bgColor="#999999"> <img alt="www.xx.at" src="pic/logo_links.jpg" width="23" height="604"></td> </tr> </table> </td> </tr> </table> </td> <td vAlign="top"> <table height="100%" cellSpacing="0" cellPadding="0" width="736" border="0"> <tr> <td style="background-image: url('pic/oben.jpg')" vAlign="top" align="right" background="pic/oben.jpg" height="100"> <table height="35" cellSpacing="0" cellPadding="3" border="0"> <tr> <td class="date" style="background-image: url('pic/ecke.gif')" vAlign="bottom" background="pic/ecke.gif"> <span id="clock"> Dienstag, 09. März 2004 - 09:26:05</span> </td> </tr> </table> </td> </tr> <tr> <td class="text1" style="background-image: url('pic/mitte1.jpg')" background="pic/mitte1.jpg" height="15"> </td> </tr> <tr> <td> <table height="100%" cellSpacing="1" cellPadding="0" width="100%" bgColor="#000000" border="0"> <tr> <td noWrap bgColor="#efefef"> <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td class="text1" style="background-image: url('pic/bg_l.jpg')" vAlign="top" noWrap width="140" background="pic/bg_l.jpg"> <table height="100%" cellSpacing="0" cellPadding="2" width="100%" border="0"> <tr> <td class="text1" vAlign="top" noWrap> <table cellSpacing="0" cellPadding="2" width="100%" border="0"> <tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Übersicht::</td> </tr> </table> <a class="menu1" href="main.php?core=startseite">Startseite</a> </td> </tr> <tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Contact:</td> </tr> </table> <a class="menu1" href="main.php?core=bernhard">Bernhard</a><br> <a class="menu1" href="main.php?core=michael">Michael</a> </td> </tr> <tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Act's::</td> </tr> </table> <a class="menu1" href="main.php?core=bpm-junkie">BPM-Junkie</a><br> <a class="menu1" href="main.php?core=equinox">Equinox</a><br> <a class="menu1" href="main.php?core=gogos">Gogos</a><br> <a class="menu1" href="main.php?core=gtp">GTP</a><br> <a class="menu1" href="main.php?core=hankey">Hankey</a><br> <a class="menu1" href="main.php?core=rotter-tom">Rotter Tom</a><br> <a class="menu1" href="main.php?core=villian">Villian</a><br> <a class="menu1" href="main.php?core=x-treme">X-Treme</a><br> <a class="menu1" href="main.php?core=interview">Interview</a> </td> </tr> <tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Events::</td> </tr> </table> <a class="menu1" href="main.php?core=date">Date</a><br> <a class="menu1" href="main.php?core=pics">Pics</a><br> <a class="menu1" href="main.php?core=video">Video</a> </td> </tr> <tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Community::</td> </tr> </table> <a class="menu1" href="main.php?core=board">Board</a><br> <a class="menu1" href="main.php?core=partner">Partner</a><br> <a class="menu1" href="main.php?core=info">Info</a> </td> </tr>
<tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Shop::</td> </tr> </table> <a class="menu1" href="main.php?core=shop">Speedcore</a><br> <a class="menu1" href="www.gabber.at">Gabber</a> </td> </tr>
<tr> <td class="text2" noWrap> <table id="headline" width="100%"> <tr> <td class="menu_top">Log In::</td> </tr> </table> <a class="menu1" href="main.php?core=admin">Admin</a><br> <a class="menu1" href="main.php?core=newsletter">Newsletter</a> </td> </tr>
</table> </td> </tr> </table> </td> <td width="1" bgColor="#c0c0c0"> <img height="1" alt="www.xx.at" src="pic/leer.gif" width="1"></td> <td class="text1" vAlign="top"> <table height="100%" cellSpacing="0" cellPadding="4" width="100%" border="0"> <tr> <td class="text1" vAlign="top"> <table id="headline" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td> </td> </tr> </table> <table class="text1" cellSpacing="0" cellPadding="3" width="100%" border="0"> <tr> <td class="text2" vAlign="top"> <table cellSpacing="0" cellPadding="0" border="0"> <tr> <td class="text2" vAlign="top"> <?php if (isset ($_REQUEST["fehler"])) { echo "Die Zugangsdaten waren ungültig."; } ?>
<form action="login.php" method="post"> Name: <input type="text" name="name" size="20"><br> Kennwort: <input type="password" name="pwd" size="20"><br> <input type="submit" value="Login">
</td> </tr> </table> </td> </tr> </table> <table id="headline" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td class="text2"> </td> </tr> </table> </td> </tr> </table> </td> <td width="1" bgColor="#c0c0c0"> <img height="1" alt="www.xx.at" src="pic/leer.gif" width="1"></td> </tr> </table> </td> </tr> <tr> <td class="copy" style="background-image: url('pic/unten.jpg')" background="pic/unten.jpg" height="19"> <p align="right"> <a class="mail" href="mailto:christopher@weber.kabsi.at">© 2004 xx.at</a> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td class="unten_copy" colSpan="2"><br> www.xx.at | Project & Design by <a href="mailto:christopher@weber.kabsi.at"> Christopher Weber</a></td> </tr> </table> </center>
</body>
</html>
Bitte um hilfe. MFG WEBER CH
hi,
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /opt/lampp/htdocs/speedcore/admin1.php:1) in /opt/lampp/htdocs/speedcore/admin1.php on line 1
du hast vermutlich den hinweis in der erklärung zu session_start() übersehen,
"Anmerkung: Bei Verwendung Cookie-basierter Sessions müssen Sie session_start() aufrufen, bevor irgend etwas an den Browser geschickt wird."
btw: das thema hat wirklich schon einen bart ...
gruß,
wahsaga
Hello ja das mache ich eh! Ganz oben im quelltext steht ja eh:
<?php session_start (); ?>
Hi,
Hello ja das mache ich eh! Ganz oben im quelltext steht ja eh:
<?php session_start (); ?>
es darf auch vor dem Start der Session kein(e) Leerzeichen/-zeile außerhalb des PHP-Blocks stehen, also
falsch:
---
Zeile 1:
Zeile 2:<?php
Zeile 3:
Zeile 4:session_start();
...
---
auch falsch:
---
Zeile 1: <?php
Zeile 2:
Zeile 3:session_start();
...
---
richtig:
---
Zeile 1:<?php
Zeile 2:
Zeile 3:session_start();
...
---
Gruß,
Andreas.
Servus Andreas!
Passt danke jetzt funkt es wieder! :-)
MFG WEBER CH
Hello,
es darf auch vor dem Start der Session kein(e) Leerzeichen/-zeile außerhalb des PHP-Blocks stehen, also
falsch:
Zeile 1:
Zeile 2:<?php
Zeile 3:
Zeile 4:session_start();
...auch falsch:
Zeile 1: <?php
^
Zeile 2:
Zeile 3:session_start();
...
Das sieht man aber kaum, was Du meintest. Ich wollte schon meckern. Aber dann fiel mir glücklicherweise das Leerzeichen in der ersten Zeile VOR dem PHP-Bereich noch auf... ;-))
Harzliche Grüße aus http://www.annerschbarrich.de
Tom