Giihh 6 Denunciar post Postado Agosto 12, 2015 Olá, O que significa o erro : Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\meuprojeto\menu_tabs.php:13) in C:\wamp\www\meuprojeto\views\tab1.php on line 29 No tab1.php coloquei o script abaixo, assim que carrega a página esta salvando no DB mesmo sem clicar no botão que contem o name "btn-save" if(isset($_POST['btn-save'])) { $variavel_atualizada = $outra_variavel; if($crud->teste($variavel_atualizada)) { header("Location: teste.php?inserted"); } else { header("Location: teste.php?failure"); } } ?> <?php if(isset($_GET['inserted'])) { ?> <div class="container"> <div class="alert alert-info"> <strong>WOW!</strong> Record was inserted successfully <a href="index.php">HOME</a>! </div> </div> <?php } else if(isset($_GET['failure'])) { ?> <div class="container"> <div class="alert alert-warning"> <strong>SORRY!</strong> ERROR while inserting record ! </div> </div> <?php } ?> Sem tab funciona corretamente, mas dentro do tab não esta funcionando, salva ao carregar a página, quando deveria salvar somente ao clicar no botão, mesmo salvando no DB não aparece a mensagem que contem no if(isset($_GET['inserted'])) Agradeço ajuda Compartilhar este post Link para o post Compartilhar em outros sites
Giihh 6 Denunciar post Postado Agosto 12, 2015 Resolvido,eu estava colocando o trecho; if(isset($_POST['btn-save'])) { $variavel_atualizada = $outra_variavel; if($crud->teste($variavel_atualizada)) { header("Location: teste.php?inserted"); } else { header("Location: teste.php?failure"); } } No no inicio do header.php de outro arquivo :S Compartilhar este post Link para o post Compartilhar em outros sites