Jump to content
GIGN Forum

Php Sessions


RaaapuLis
 Share

Recommended Posts

Vai kāds varētu palīdzēt? :D

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\index.php:2) in C:\AppServ\www/index.php on line 3

un 3 līnijas ir session_start();

Un pirms viņas nau izvades...

<meta charset="utf-8">
<?php 
session_start(); 

$username = $_SESSION['username']; 
$password = $_SESSION['password']; 


if(!$username && !$password){ 
echo "Sveiks Viesi! <br> <a href=login.php>Ielogoties</a> | <a href=register.php>Registreties</a>"; 
}else{ 
echo "Sveiks ".$username." (<a href=logout.php>Iziet</a>)"; 
} 


?>

kas tas par error?

P.S. aizmirsu apteikt, ka charsets ir utf-8 without BOM

Edited by RaaapuLis
Link to comment
Share on other sites

Un kas tad ir šis <meta charset="utf-8"> ?

Link to comment
Share on other sites

Saglabā vnk kā utf-8 BOM`i ir vajadzīgi!

Link to comment
Share on other sites

Ups, tikkai tagad kārtīgi iedziļinājos tavā pereklī, problēma ir līkā kodā, meiģini šādi:

<?php

session_start();

if(!isset($_SESSION['username']) && !isset($_SESSION['password'])){

echo "Sveiks Viesi! <br> <a href=login.php>Ielogoties</a> | <a href=register.php>Registreties</a>";

}else{

echo "Sveiks ".$username." (<a href=logout.php>Iziet</a>)";

}

?>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...