Warning: session_start()
Posted by: Hase (---.dlp194.bih.net.ba)
Date: January 08, 2006 03:56PM

Hello,

When I use:
Apache 1.x.x
PHP 4.3.1
MySQL 3.23
all working is OK, but I use
Wamp5-1.6.0 dont wok.

I have script:
<?php
// Kreiranje sesije za korisnika
session_start();

// "Smjestanje" promjenjive imena baze podataka koja se dobije iz prijavljujuce
// datoteke index.php u sesiju
$CfgDBName = $_REQUEST['y'];
$_SESSION['y'] = $_REQUEST['y'];

// Promjenjive koje se dobijaju iz datoteke index.php
$username = $HTTP_POST_VARS["username"];
$password = $HTTP_POST_VARS["password"];

// Potrebna zaglavlja
require("./include/user.h.php"winking smiley;
require("./include/messages.h.php"winking smiley;
require("./include/display.h.php"winking smiley;

// Why are there two "new" calls here? Is there some issue with creating a
// User object with an invalid username? If that's the case, then we should
// be able to solve the problem using the "exists()" method of the user class.
$user = new User();
$user = new User($username);

// Provjera za ispravnost korisnickog imena i lozinke
if($user->authenticate($username, $password) && $username != ""winking smiley
{
// Kriptovanje lozinke
$password = md5($password);

// Postavljanje unesenog korisnickog imena i lozinke u globalne promjenjive
$MERCEDESBENZName = $username;
$MERCEDESBENZPass = $password;

// Prijavljivanje se zapisuje u drvo poruka
setLogMessages($user->getFullname(), "\$autoline008"winking smiley;

// Redirekcija na index.php u poddirektoriju data
header("Location: ./data/"winking smiley;
}
else
{
// Neuspijeh u prijavi se zapisuje u drvo poruka
setLogMessages($username, "\$al005"winking smiley;

// Pozivanje sablonskih datoteka
$cs = implode(" ", file("./template/error.html"winking smiley);

$cs = str_replace("{title}", $al005, $cs);
$cs = str_replace("{ErrorMessage}", "<font color='red'>".$al005."</font>", $cs);
$cs = str_replace("{ContactPerson}", $al002, $cs);
echo $cs;
}

?>

Web borwser:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\www\login.php:1) in D:\www\login.php on line 1

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\www\login.php:1) in D:\www\login.php on line 1

Options: ReplyQuote
Re: Warning: session_start()
Posted by: Romain Bourdon (---.w193-251.abo.wanadoo.fr)
Date: January 10, 2006 09:28AM

You must have a space or a \n before your <?php tag so the session_start() doesn't work.

Romain

Options: ReplyQuote
Re: Warning: session_start()
Posted by: Hase (---.dlp317.bih.net.ba)
Date: January 10, 2006 08:43PM

Hi, Thanks for answer, but i have again same problem, with space or new line, or without space or new line.
I don't know solve my problem, please help me.

Thanks beforehand.

Options: ReplyQuote
Re: Warning: session_start()
Posted by: Christian (---.hawaiiantel.net)
Date: January 11, 2006 06:58PM

add this to the start of the php doc <?php ob_start();
add this to the end of the php doc ob_end_flush(); ?>


Options: ReplyQuote
Re: Warning: session_start()
Posted by: Hase (---.dlp112.bih.net.ba)
Date: January 12, 2006 08:51PM

Thanks
But, I have found problem
Problem is coding document page
uuuuuuuuuuu :-o

Options: ReplyQuote
Re: Warning: session_start()
Posted by: Christopher (---.onocable.ono.com)
Date: January 18, 2006 08:35AM

Hi, I've noticed that setting session.auto_start = 1 makes even loading the localhost index page fail with a fresh install.

Options: ReplyQuote


Sorry, only registered users may post in this forum.