Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Warning: session_start() [function.session-start] błąd
darosevic
post 6.05.2014, 18:10:20
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 6.05.2014

Ostrzeżenie: (0%)
-----


Witam. nie wiem od czego zależy ale mam na stałe taki błąd

Cytat
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/botdorek/public_html/index.php:1) in /home/botdorek/public_html/index.php on line 2



Jak go naprawić ?
Go to the top of the page
+Quote Post
trueblue
post 6.05.2014, 18:14:00
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1827
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Usuń wszelkie znaki przed session_start().
Przed session_start() mają nie być wywoływane inne funkcje.
Jeśli plik jest kodowany w UTF-8, to zmień na UTF-8 bez BOM.

Ten post edytował trueblue 6.05.2014, 18:15:24


--------------------
Go to the top of the page
+Quote Post
johny_s
post 6.05.2014, 18:14:43
Post #3





Grupa: Zarejestrowani
Postów: 594
Pomógł: 122
Dołączył: 17.07.2005
Skąd: P-na

Ostrzeżenie: (0%)
-----


nie wysyłać nic do przeglądarki zanim nie wywołasz funkcji session_start()
Go to the top of the page
+Quote Post
com
post 6.05.2014, 18:18:13
Post #4





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


bardziej znaki przed <?php, tzn konkretnie chodzi o to, że strona została już wygenerowana zanim stworzyłeś sesje, czyli tak jak napisał trueblue lub html, lub zwykłe echo, takie problemy to wczesne przedszkole, wiec nie ten dział wink.gif
Go to the top of the page
+Quote Post
darosevic
post 6.05.2014, 18:28:37
Post #5





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 6.05.2014

Ostrzeżenie: (0%)
-----


Podam cały kod najlepiej, może ktoś znajdzie błą owy

Cytat
<?php
session_start();
ob_start();

//echo '<pre>';
//print_r($_SESSION);
//sleep(1);
//echo '</pre>';

function getTime()
{
$a = explode (' ',microtime());
return(double) $a[0] + $a[1];
}
$Start = getTime();
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BOT :: LipA</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Bot reklamujący www.sh.st/wAPyn">
<meta name="author" content="Nieznany - www.sh.st/wAPyn">

<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 20px;
padding-bottom: 40px;
}

/* Custom container */
.container-narrow {
margin: 0 auto;
max-width: 800px;
}
.container-narrow > hr {
margin: 30px 0;
}

/* Main marketing message and sign up button */
.jumbotron {
margin: 60px 0;
text-align: center;
}
.jumbotron h1 {
font-size: 72px;
line-height: 1;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}

/* Supporting marketing content */
.marketing {
margin: 60px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
</style>

<script type="text/javascript" src="bbeditor/ed.js"></script>
</head>

<body>

<div class="container-narrow">

<div class="masthead">
<ul class="nav nav-pills pull-right">
<li <?if(!$_GET['s']) echo 'class="active"';?>><a href="./">Reklamuj</a></li>
<li <?if($_GET['s'] == 'lista') echo 'class="active"';?>><a href="./?s=lista">Konta</a></li>
<li <?if($_GET['s'] == 'dodaj') echo 'class="active"';?>><a href="./?s=dodaj">Dodaj konto</a></li>
<li <?if($_GET['s'] == 'historia') echo 'class="active"';?>><a href="./?s=historia">Historia</a></li>
<li><a href="http://www.sh.st/wAPyn" target="_blank">MASTER BOOST</a></li>
</ul>
<li><a href="http://www.sh.st/wAPyn" target="_blank">MASTER BOOST</a></li>
</div>

<hr>
<?php

if(!function_exists('curl_init')){
echo '<div class="alert alert-error">Twój hosting nie obsługuje biblioteki cURL. Bot nie będzie działał.</div>';
}

define('BOT', true);
include ('config.php');

if(!$install){
include ('install.php');
}else{
include ('include/funkcje.php');

if(file_exists('install.php')){
unlink('install.php');
}
?>

<div class="jumbotron">

<?php

$site = $_GET['s'];

if($site){
if(file_exists(dirname(__FILE__) . '/include/'.$site.'.php')){
include(dirname(__FILE__) . '/include/'.$site.'.php');
}else{
include ('include/glowna.php');
}
}else{
include ('include/glowna.php');
}
?>

</div>

<?php }?>

<hr>

<div class="footer">
<p>&copy; 2014 by <a href="gg:11665253">Aragog</a><br>Kodowanie:<a href="gg:34814170">LipA</a><br>Grafika:<a href="gg:43544927">Kir0</a>
<br><?php
$End = getTime();
echo "Czas wykonywania: ".number_format(($End - $Start),4)."s";
?><br>
Odwiedź forum <a href="http://http://www.sh.st/wAPyn" target="_blank">MASTER BOOST</a>
</p>
</div>
</div>
</body>
</html>
Go to the top of the page
+Quote Post
com
post 6.05.2014, 18:36:15
Post #6





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


skoro jest ob_start to jeszcze by sie przydało http://www.php.net/manual/pl/function.ob-flush.php

http://www.php.net/manual/pl/function.ob-start.php patrz na przykład smile.gif
Go to the top of the page
+Quote Post
darosevic
post 6.05.2014, 18:39:36
Post #7





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 6.05.2014

Ostrzeżenie: (0%)
-----


Bardzo mi to dużo mówi te przykłady biggrin.gif

mógłbyś mi to po prostu wkleić w kod, tam gdzie powinno to być ? Ja w te klocki to cienki jestem smile.gif
Go to the top of the page
+Quote Post
markuz
post 6.05.2014, 18:55:44
Post #8





Grupa: Zarejestrowani
Postów: 1 240
Pomógł: 278
Dołączył: 11.03.2008

Ostrzeżenie: (0%)
-----


W jakim edytorze zapisywałeś ten plik?

Błąd jest na 80% z nagłówkami - musisz zapisać jako UTF-8 bez BOM jak napisał @trueblue.

Ten post edytował markuz 6.05.2014, 18:56:49


--------------------
Go to the top of the page
+Quote Post
darosevic
post 6.05.2014, 18:58:05
Post #9





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 6.05.2014

Ostrzeżenie: (0%)
-----


w notatniku to mam

wrzuciłem to na neta i daje link do tego

http://speedy.sh/mn9cN/index.php

Ten post edytował darosevic 6.05.2014, 19:01:41
Go to the top of the page
+Quote Post
markuz
post 6.05.2014, 19:01:09
Post #10





Grupa: Zarejestrowani
Postów: 1 240
Pomógł: 278
Dołączył: 11.03.2008

Ostrzeżenie: (0%)
-----


W takim razie błąd w 100% tkwi w nagłówku.
Pobierz np. Notepad++
I w menu w kodowaniu wybierz UTF-8 bez BOM - zapisz - i wszystko bd śmigać.


--------------------
Go to the top of the page
+Quote Post
com
post 6.05.2014, 19:12:05
Post #11





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


a na koniec wrzuć tam:
  1. <?php
  2.  
  3.  
  4. ?>

bo skoro już go używasz, to nie potrzebnie to trzyma w buforze...
No a problemem bylo kodowane jak już powiedziano wink.gif
Go to the top of the page
+Quote Post
darosevic
post 6.05.2014, 19:31:37
Post #12





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 6.05.2014

Ostrzeżenie: (0%)
-----


Dzięki panowie za pomoc smile.gif Wszystko Graaaaa biggrin.gif

p.s: jeśli ktoś chce, abym komuś coś zareklamował, zapraszam na priv smile.gif

Ten post edytował darosevic 6.05.2014, 19:34:20
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 8.07.2025 - 02:38