Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\index.php:12) in C:\AppServ\www\login.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\index.php:12) in C:\AppServ\www\login.php on line 2
Pergunta
JaguA
Minha pagina ta dando esse erro..
Essa é o meu login.php<? session_start(); $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; // Incluindo arquivos require "_req/config.php"; require "_req/cnn.php"; require "_req/anti_inject.php"; require "_req/sql_protect.php"; if (isset($_SESSION['ses_login'])) { $dados_login_q = mssql_query("SELECT * FROM users WHERE Login='$ses_login'"); $dados_login = mssql_fetch_array($dados_login_q); } ?> <? if (!$ses_login) { echo "<table border='0' cellpadding='0' cellspacing='0' width='183'> <tr> <td background='_img/login_bg.gif' valign='top'> <table border='0' cellpadding='0' cellspacing='0' width='183'> <tr> <td height='39'></td> </tr> <tr><form name='form1' method='post' action='?'> <td height='36'> <table border='0' cellpadding='0' cellspacing='0' height='40' width='183'> <tr valign='top'> <td height='19' width='52'></td> <td width='79'><input name='ses_login' type='text' id='ses_login' size='10' class='input'></td> <td rowspan='2' valign='middle' width='52'><input name='submit' src='_img/login_bt_in.gif' border='0' height='36' type='image' width='38'></td> </tr> <tr> <td height='20'></td> <td><input name='ses_senha' type='password' id='ses_senha' size='10' class='input'></td> </tr> </table> </td></form> </tr> <tr> <td height='64' valign='top'><table border='0' cellpadding='0' cellspacing='0' height='4' width='183'> <tr> <td></td> </tr> </table> <table border='0' cellpadding='0' cellspacing='0' width='183'> <tr> <td> <table border='0' cellpadding='0' cellspacing='0' width='183'> <tr> <td height='21' width='57'></td> <td><a href='?i=c900a8bc5d4'><img src='_img/usuario_cadastro.gif' border='0' height='17' width='106'></a></td> </tr> <tr> <td height='21'></td> <td><a href='?i=1f1c03efbf0'><img src='_img/usuario_recuperarsenha.gif' border='0' height='17' width='106'></a></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td></tr></table> "; } else { $level_check = mssql_query("SELECT level FROM users WHERE Login='$ses_login'"); $level = mssql_result($level_check, 0, 0); if ($level == 0) { $painel = "Painel do Usuário"; $dir = "painel"; } if ($level == 1) { $painel = "Painel do Game Master"; $dir = "gm"; } echo "<table border='0' cellpadding='0' cellspacing='0' width='183'> <tr> <td background='_img/login_bg_seson.gif' valign='top'> <table border='0' cellpadding='0' cellspacing='0' width='183' height='143'> <tr> <td class='usuario'><div align='center'><b>Bem Vindo: $ses_login</b><br><br><b><a href='?i=$dir'><span class='usuario'>$painel</span></a><b><br><br><b><a href='?i=215521f1d88'><span class='usuario'>Sair</span></a></b></div></td> </tr> </table></td></tr></table>"; } if(isset($_POST['ses_login'])){ $ses_login=$_POST['ses_login']; $ses_senha=$_POST['ses_senha']; $ses_senha = md5($ses_senha); $qChecaLogin = mssql_query("SELECT * FROM users WHERE Login='".$ses_login."'"); $ChecaLogin = mssql_num_rows($qChecaLogin); if ($md5 == 1) { $qChecaSenha = mssql_query('exec ChecaSenha "'.$ses_senha.'", "'.$ses_login.'"'); $ChecaSenha = mssql_num_rows($qChecaSenha); } else { $qChecaSenha = mssql_query("SELECT * FROM users WHERE Login='".$ses_login."' AND passwd='".$ses_senha."'"); $ChecaSenha = mssql_num_rows($qChecaSenha); } if ((eregi("[^0-9a-zA-Z._-]", $ses_login)) || (eregi("[^0-9a-zA-Z]", $ses_senha)) ) inject(); elseif($ChecaLogin == 0) { echo "<script>alert('Login não encontrado')</script>"; echo "<script>window.location='?'</script>"; } elseif($ChecaSenha == 0) { echo "<script>alert('Senha Incorreta')</script>"; echo "<script>window.location='?'</script>"; } else { $level_check = mssql_query("SELECT level FROM users WHERE Login='$ses_login'"); $level = mssql_result($level_check, 0, 0); if ($level <= 0) { $dir = 'painel'; } if ($level >= 1) { $dir = 'gm'; } session_start(); $_SESSION["ses_login"]=$ses_login; echo "<script>window.location='?i=$dir'</script>"; } } ?>Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.