04. november 2004 - 21:27
Der er
13 kommentarer og 1 løsning
Mystisk fejl!
Warning: Cannot send session cookie - headers already sent by (output started at /customers/tiger-networks.net/tiger-networks.net/httpd.www/index.php:9) in /customers/tiger-networks.net/tiger-networks.net/httpd.www/index.php on line 46 Warning: Cannot send session cache limiter - headers already sent (output started at /customers/tiger-networks.net/tiger-networks.net/httpd.www/index.php:9) in /customers/tiger-networks.net/tiger-networks.net/httpd.www/index.php on line 46 Her er den fejl jeg får når jeg vil gå ind på min hjemmeside som jeg lige har uploaded! er der nogen der har en idé om hvad det kan være jeg har prøvet det meste men jeg er ikke så hård til php endnu så jeg kan nemt have overset noget!
Annonceindlæg fra Computerworld it-jobbank
Slettet bruger
04. november 2004 - 21:29
#1
din session_start(); skal være den første kommando i koden..!
04. november 2004 - 21:35
#2
Ja, du må ikke udskrive noget i koden før din cookie kommer
04. november 2004 - 21:36
#3
Det har jeg også! her er koden! <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Tiger Networks</title> <META NAME="Description" CONTENT="This homepage contains a lot of good stuff"> <META NAME="Author" CONTENT="Nikolaj Oe Hansen"> <META NAME="Classification" CONTENT="It programming"> <META NAME="Keywords" CONTENT="palm, script, homepage, network, games, mp3, ftp, server, IT guides, car, downloads"> <META NAME="Reply-to" CONTENT="nikolaj@tiger-networks.net"> <META NAME="Title" CONTENT="tiger Networks"> <META-EQUIVE="Expires" CONTENT="1-12-2300"> <META NAME="Revisit-after" CONTENT="1 days"> <style type="text/css"> <!-- .style1 { color: #780001; font-weight: bold; } .style2 {color: #550000} .style3 {color: #560001} a:link { text-decoration: none; color: #780001; } a:visited { text-decoration: none; color: #780001; } a:hover { text-decoration: none; color: #FFFFFF; } a:active { text-decoration: none; } .style4 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #CCCCCC; } --> </style> </head> <? session_start(); include "database.php"; include "bruger.php"; ?> <body> <table width="795" height="154" border="0" align="center" style="background-repeat:no-repeat" background="TigerNetworks-IT-Design.jpg"> <tr> <td height="56" colspan="5" style="background-repeat:no-repeat"> </td> </tr> <tr> <td height="21" colspan="3" style="background-repeat:no-repeat"> </td> <td width="418" style="background-repeat:no-repeat"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <marquee scrollamount="6"> </marquee> </font> <font size="2"> <marquee scrollamount="6"> </marquee> </font> <div align="center" class="style1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <span class="style2">::</span> <a href="Script.php" target="mainFrame">Script</a> <span class="style2">::</span> <a href="Download.php" target="mainFrame">Downloads</a> <span class="style2">::</span> <a href="logind.php" target="mainFrame">User</a> <span class="style2">::</span> <a href="Contact.php" target="mainFrame">Contact</a> <span class="style2">::</span> <a href="tagwall.php" target="mainFrame">Tagwall</a> <span class="style3">:: </span></font> </div></td> <td width="30" style="background-repeat:no-repeat"> </td> </tr> <tr bordercolor="#D4D0C8"> <td width="8" height="21" style="background-repeat:no-repeat"> </td> <td width="224" style="background-repeat:no-repeat"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#CCCCCC"> <? $bruger = new bruger(); if( $bruger->logget_ind() ){ echo "You are logget in as <b>" ; echo $bruger->hent_brugernavn(); echo "</b>"; }else{ echo "You are not logged in!"; } ?> </font> </td> <td width="93" style="background-repeat:no-repeat"><div align="left" class="style4"></div></td> <td height="21" style="background-repeat:no-repeat"> </td> <td height="21" style="background-repeat:no-repeat"> </td> </tr> <tr bordercolor="#D4D0C8"> <td height="21" colspan="5" style="background-repeat:no-repeat"> <center> <iframe width="780" height="600" frameborder="0" src="mainframe.htm" name="_iframe"></iframe> </center> </td> </tr> <tr bordercolor="#D4D0C8"> <td height="21" colspan="5" style="background-repeat:no-repeat"> </td> </tr> </table> </body> </html>
Slettet bruger
04. november 2004 - 21:39
#4
starter du også din session i database.php eller bruger.php? prøv at flytte den HELT op i toppen..
04. november 2004 - 21:39
#5
<? session_start(); include "database.php"; include "bruger.php"; ?> som gartzen siger: Flyt ovenstående helt op i toppen af din side.. Altså før <html>
Slettet bruger
04. november 2004 - 21:39
#6
eller er denne fil includeret i en anden?
04. november 2004 - 21:41
#7
nej det er min index fil som bare skal vise at der er en der er online! og den er ikke included i andre filer...
Slettet bruger
04. november 2004 - 21:44
#8
har du prøvet at sætte <? session_start(); ?> som det første i dokumentet? altså før <html>
04. november 2004 - 21:47
#9
Det har jeg lige gjort og det virker perfekt!!! Tusind Tak for den hurtige hjælp jeg har siddet og irriteret mig over den fejl i snart en time!
04. november 2004 - 21:48
#10
I kunne jo tage et kig på den! jeg regner med at den er 100% oppe at køre iaften kl 2300!
www.tiger-networks.net
Slettet bruger
04. november 2004 - 21:48
#11
var så lidt :-)
04. november 2004 - 21:53
#12
*host* et hurtigt kig på php.net's fremragende manual havde også vist dig problemet:
http://php.net/session_start --citat--
Note: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.
---
Manualen er svarende til guds ord - altid kig der først... det vil afhjælpe ca 50% af dine spørgsmål i fremtiden...
Morten
05. november 2004 - 15:16
#13
<? session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Tiger Networks</title> <META NAME="Description" CONTENT="This homepage contains a lot of good stuff"> <META NAME="Author" CONTENT="Nikolaj Oe Hansen"> <META NAME="Classification" CONTENT="It programming"> <META NAME="Keywords" CONTENT="palm, script, homepage, network, games, mp3, ftp, server, IT guides, car, downloads"> <META NAME="Reply-to" CONTENT="nikolaj@tiger-networks.net"> <META NAME="Title" CONTENT="tiger Networks"> <META-EQUIVE="Expires" CONTENT="1-12-2300"> <META NAME="Revisit-after" CONTENT="1 days"> <style type="text/css"> <!-- .style1 { color: #780001; font-weight: bold; } .style2 {color: #550000} .style3 {color: #560001} a:link { text-decoration: none; color: #780001; } a:visited { text-decoration: none; color: #780001; } a:hover { text-decoration: none; color: #FFFFFF; } a:active { text-decoration: none; } .style4 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #CCCCCC; } --> </style> </head> <? include "database.php"; include "bruger.php"; ?> <body> <table width="795" height="154" border="0" align="center" style="background-repeat:no-repeat" background="TigerNetworks-IT-Design.jpg"> <tr> <td height="56" colspan="5" style="background-repeat:no-repeat"> </td> </tr> <tr> <td height="21" colspan="3" style="background-repeat:no-repeat"> </td> <td width="418" style="background-repeat:no-repeat"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <marquee scrollamount="6"> </marquee> </font> <font size="2"> <marquee scrollamount="6"> </marquee> </font> <div align="center" class="style1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <span class="style2">::</span> <a href="Script.php" target="mainFrame">Script</a> <span class="style2">::</span> <a href="Download.php" target="mainFrame">Downloads</a> <span class="style2">::</span> <a href="logind.php" target="mainFrame">User</a> <span class="style2">::</span> <a href="Contact.php" target="mainFrame">Contact</a> <span class="style2">::</span> <a href="tagwall.php" target="mainFrame">Tagwall</a> <span class="style3">:: </span></font> </div></td> <td width="30" style="background-repeat:no-repeat"> </td> </tr> <tr bordercolor="#D4D0C8"> <td width="8" height="21" style="background-repeat:no-repeat"> </td> <td width="224" style="background-repeat:no-repeat"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#CCCCCC"> <? $bruger = new bruger(); if( $bruger->logget_ind() ){ echo "You are logget in as <b>" ; echo $bruger->hent_brugernavn(); echo "</b>"; }else{ echo "You are not logged in!"; } ?> </font> </td> <td width="93" style="background-repeat:no-repeat"><div align="left" class="style4"></div></td> <td height="21" style="background-repeat:no-repeat"> </td> <td height="21" style="background-repeat:no-repeat"> </td> </tr> <tr bordercolor="#D4D0C8"> <td height="21" colspan="5" style="background-repeat:no-repeat"> <center> <iframe width="780" height="600" frameborder="0" src="mainframe.htm" name="_iframe"></iframe> </center> </td> </tr> <tr bordercolor="#D4D0C8"> <td height="21" colspan="5" style="background-repeat:no-repeat"> </td> </tr> </table> </body> </html>
Slettet bruger
05. november 2004 - 15:47
#14
rhandersen -> hvorfor det spam?
Vi tilbyder markedets bedste kurser inden for webudvikling