Zoom Posted March 21, 2005 Report Share Posted March 21, 2005 (edited) Tadam man ir registresanas skripts. Es ielogojos, un man izmet zinojumu "esi ielogojies!". Tatad man vaiga lai so zinojumu neizvaditu, bet gan uzreiz parmestu uz news.php Ka man to izdarit ?Meiginaju ar header, bet saka ka errors. Domaju tas ir viegli, bet es pagaidam vel nevaru izdomat. rekur man skripta dala: if($logged_in){ echo "<h1>Gatavs!</h1>"; echo " <b>$_SESSION[username]</b>, Tu esi ielogojies. <a href=\"logout.php\">Izlogoties</a>"; } Edited March 21, 2005 by Zoom Link to comment Share on other sites More sharing options...
hu_ha Posted March 21, 2005 Report Share Posted March 21, 2005 if($logged_in){ header('Location:news.php'); pie nosacījuma, ka pirms šīm rindiņām nav neviena izvada bijis. Ir vienkārši. Link to comment Share on other sites More sharing options...
Zoom Posted March 21, 2005 Author Report Share Posted March 21, 2005 te viss login skripts: http://paste.php.lv/1771 Kad es to ielieku man rada error ! 80 rindaa Link to comment Share on other sites More sharing options...
Venom Posted March 21, 2005 Report Share Posted March 21, 2005 nu, piem. skatoties tieši tur, pareizi būtu: echo 'Welcome <b>'.$_SESSION['username'].'</b>, you are logged in. <a href="logout.php">Logout</a>'; Link to comment Share on other sites More sharing options...
Zoom Posted March 21, 2005 Author Report Share Posted March 21, 2005 nu, piem. skatoties tieši tur, pareizi būtu: echo 'Welcome <b>'.$_SESSION['username'].'</b>, you are logged in. <a href="logout.php">Logout</a>'; 15331[/snapback] Man vaiga lai vins pec ielogosanas uz reiz redirekte uz kaduphpfailu.php :) Link to comment Share on other sites More sharing options...
hu_ha Posted March 21, 2005 Report Share Posted March 21, 2005 vai tiešām pamēģināji echo "<h1>Gatavs!</h1>"; aizvietot ar header('Location:news.php'); exit(); Link to comment Share on other sites More sharing options...
Zoom Posted March 25, 2005 Author Report Share Posted March 25, 2005 izmeta ara sadu erroru Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\reg\main.php:13) in C:\Program Files\Apache Group\Apache2\htdocs\reg\login.php on line 78 Skatijos main.php 13 rindinu: <? /* Include Files *********************/ session_start(); include("database.php"); include("login.php"); /*************************************/ ?> <html> <title>Jpmaster77's Login Script</title> <body> <? displayLogin(); ?> </body> </html> <? displayLogin(); ?> ja so funkciju iznam ara tad vispar ir tuksum ieks main.php pat neparadas includ faili Link to comment Share on other sites More sharing options...
hmnc Posted March 25, 2005 Report Share Posted March 25, 2005 Nu bet angļu valodu skolās nemāca? [B]headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\reg\main.php:13) in C:\Program Files\Apache Group\Apache2\htdocs\reg\login.php on line 78[/B] ? tas nozīmē to, ka login.php skripta 78 rindiņā tu mēģini setot headerus, bet to nevar izdarīt, jo kaut kāda izvade tev jau ir main.php faila 13tajā rindiņā. doooh. Link to comment Share on other sites More sharing options...
Zoom Posted March 25, 2005 Author Report Share Posted March 25, 2005 Nu bet angļu valodu skolās nemāca? [B]headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\reg\main.php:13) in C:\Program Files\Apache Group\Apache2\htdocs\reg\login.php on line 78[/B] ? tas nozīmē to, ka login.php skripta 78 rindiņā tu mēģini setot headerus, bet to nevar izdarīt, jo kaut kāda izvade tev jau ir main.php faila 13tajā rindiņā. doooh. 15580[/snapback] To es saprotu man main.php login funkcija ierakstita. Baigias cakars... Link to comment Share on other sites More sharing options...
hmnc Posted March 25, 2005 Report Share Posted March 25, 2005 To es saprotu man main.php login funkcija ierakstita. Baigias cakars... 15585[/snapback] nu bet nav jau starpības kur tev login funkcija ierakstīta. galvenais ir atrast to vietu, kur tev ir izvade un likvidēt to. Link to comment Share on other sites More sharing options...
spynode Posted March 25, 2005 Report Share Posted March 25, 2005 gadās... Link to comment Share on other sites More sharing options...
Recommended Posts