shumo Ierakstīts Oktobris 5, 2009 Share Ierakstīts Oktobris 5, 2009 Esmu uztaisijis ielogoshanos shemu, kad tiek checko vai ir ielogojie kaa admins, vai kaa students. Shi sistema funkcionee uz wamp, bet kaa uzlieku uz cita servera taa met araa erroru Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\easyphp1-8\www\login2system\index.php:1) in c:\easyphp1-8\www\login2system\index.php on line 2 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\easyphp1-8\www\login2system\index.php:1) in c:\easyphp1-8\www\login2system\index.php on line 2 Varbūt kāds var palīdzēt? index.php lapas kods ir shads. <?php session_start(); include("database.php"); if (isset($_SESSION['user'])){ header ("Location: students.php"); ?> <?php } elseif(isset($_SESSION['admin'])){ header("Location: admins.php"); ?> <?php }else{ ?> <form name="login_form" method="post" action="login2.php"> <label> <input name="user" type="text" id="user">ID<br /> <input name="pass" type="password" id="pass">Password<br /> </label> <input type="submit" name="login" id="login" value="Login"> </label> </p> </form> <form name="news" method="post" action="news.php"> <input type="submit" name="news" id="news" value="News"> </form> <?php } ?> Link to comment Share on other sites More sharing options...
Aleksejs Oktobris 5, 2009 Share Oktobris 5, 2009 http://php.lv/f/topic/7294-headers-already-sent/ Link to comment Share on other sites More sharing options...
binary Oktobris 5, 2009 Share Oktobris 5, 2009 Leshij, ja kļūda ir 2. rindā, tad kā to ietekmē tevis minētie koda gabali, kas ir aiz 2. rindas? imho palikusi utf8 signature jeb BOM (kā nu kurā vietā saucas). Link to comment Share on other sites More sharing options...
binary Oktobris 5, 2009 Share Oktobris 5, 2009 Leshij, nestrādātu visos serveros ar vienu nosacījumu - visiem serveriem jābūt ar izslēgtu output bufferingu. Ja output bufferings ir ieslēgts, tad strādās. P.S. Leshij, mans jautājums paliek spēkā Link to comment Share on other sites More sharing options...
Recommended Posts
Izveido kontu, vai pieraksties esošajā, lai komentētu
Jums ir jābūt šī foruma biedram, lai varētu komentēt tēmas
Izveidot jaunu kontu
Piereģistrējies un izveido jaunu kontu, tas būs viegli!
Reģistrēt jaunu kontuPierakstīties
Jums jau ir konts? Pierakstieties tajā šeit!
Pierakstīties tagad!