Johny Posted November 23, 2009 at 09:36 PM Report Share #297340 Posted November 23, 2009 at 09:36 PM Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ Warning: Cannot modify header information - headers already sent by (output started at /home/ Gostava de saber o porque de me dar estes erros? ############# Link to comment Share on other sites More sharing options...
scorch Posted November 23, 2009 at 10:22 PM Report Share #297347 Posted November 23, 2009 at 10:22 PM Isso é porque o session_start(); tem de estar no ínicio dos documentos, mesmo depois do <?php e sem nada antes. http://wiki.portugal-a-programar.pt/dev_web:php:problemas_comuns_em_php#sessoes PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
Johny Posted December 5, 2009 at 12:02 PM Author Report Share #298771 Posted December 5, 2009 at 12:02 PM Qual é a maneira correcta? <?php defined('_VALID_REQUIRE') or die ('Direct access not allowed.'); require_once("includes/ban.php"); session_start(); ob_start(); if (isset($_SESSION["login_user"]) AND isset($_SESSION["senha_user"])) { $login_usuario = $_SESSION["login_user"]; $senha_usuario = $_SESSION["senha_user"]; require_once("includes/ligacao.php"); ?> ou <?php session_start(); ob_start(); defined('_VALID_REQUIRE') or die ('Direct access not allowed.'); require_once("includes/ban.php"); if (isset($_SESSION["login_user"]) AND isset($_SESSION["senha_user"])) { $login_usuario = $_SESSION["login_user"]; $senha_usuario = $_SESSION["senha_user"]; require_once("includes/ligacao.php"); ?> Porque tanto numa como outra dá o erro Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /..... Se me poderem ajudar agradecia =) ############# Link to comment Share on other sites More sharing options...
yoda Posted December 5, 2009 at 07:38 PM Report Share #298835 Posted December 5, 2009 at 07:38 PM Verifica se não tens nennhum caracter em branco antes do sessio_start(). O erro diz que os headers já foram enviados, o que significa que o output já começou em algum ponto. De qualquer modo, a segunda opção é a melhor. before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Johny Posted December 6, 2009 at 12:00 AM Author Report Share #298872 Posted December 6, 2009 at 12:00 AM outra pergunta porquê que aparece isto no inicio da pagina?  ############# Link to comment Share on other sites More sharing options...
yoda Posted December 6, 2009 at 12:53 AM Report Share #298881 Posted December 6, 2009 at 12:53 AM Tens caracteres especiais que estão a ser interpretados sem o próprio encode. Deves ter um acento ou assim isolado, que está a ser mal interpretado before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
tuxonice Posted December 6, 2009 at 04:06 PM Report Share #298922 Posted December 6, 2009 at 04:06 PM Olá, deves ter esse ficheiro codificado em UTF-8 com BOM (http://en.wikipedia.org/wiki/Byte_order_mark). Se tiveres o Notepad++ (http://notepad-plus.sourceforge.net/br/site.htm), abre o ficheiro, vai ao menu Formatar->Converter para UTF-8 (sem BOM). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now