Jump to content
php.lv forumi

Pec login


Zoom

Recommended Posts

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 by Zoom
Link to comment
Share on other sites

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

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

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

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

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

×
×
  • Create New...