Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal estou com um problema no meu código gostaria que me ajudassem, pois quando estava rodando no wamp estava funcionando perfeitamente, mais quando enviei os arquivos para o servidor apareceu a seguinte mensagem: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/nortegra/public_html/admin/index.php:1) in /home/nortegra/public_html/admin/login.php on line 5 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/nortegra/public_html/admin/index.php:1) in /home/nortegra/public_html/admin/login.php on line 5 Segue o código abaixo:
<?php require_once('../Connections/conexao.php').?>
<?phpif (!isset($_SESSION)) { session_start(). } $loginFormAction = $_SERVER['PHP_SELF']. if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']. } if (isset($_POST['email'])) { $loginUsername=$_POST['email']. $password=$_POST['senha']. $MM_fldUserAuthorization = "nivel". $MM_redirectLoginSuccess = "admin.php". $MM_redirectLoginFailed = "login.php". $MM_redirecttoReferrer = false. mysql_select_db($database_conexao, $conexao). $LoginRS__query=sprintf("SELECT email, senha, nivel FROM usuario WHERE email=%s AND senha=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")). $LoginRS = mysql_query($LoginRS__query, $conexao) or die(mysql_error()). $loginFoundUser = mysql_num_rows($LoginRS). if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,0,'nivel'). if (PHP_VERSION >= 5.1) {session_regenerate_id(true). } else {session_regenerate_id(). } //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername. $_SESSION['MM_UserGroup'] = $loginStrGroup. if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']. } header("Location: ". $MM_redirectLoginSuccess ). } else { header("Location: ". $MM_redirectLoginFailed ). }
}?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc()? stripslashes($theValue): $theValue. } $theValue = function_exists("mysql_real_escape_string")? mysql_real_escape_string($theValue): mysql_escape_string($theValue). switch ($theType) { case "text": $theValue = ($theValue!= "")? "'". $theValue. "'": "NULL". break. case "long": case "int": $theValue = ($theValue!= "")? intval($theValue): "NULL". break. case "double": $theValue = ($theValue!= "")? doubleval($theValue): "NULL". break. case "date": $theValue = ($theValue!= "")? "'". $theValue. "'": "NULL". break. case "defined": $theValue = ($theValue!= "")? $theDefinedValue: $theNotDefinedValue. break. } return $theValue. }
}?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html. charset=utf-8" />
<title>Norte Gráfica Outdoor - Administração</title>
<link href="../css/estilo.css" rel="stylesheet" type="text/css" />
<link href="../css/bootstrap.css" rel="stylesheet" type="text/css" />
</head> <body>
<div id="logologin"></div>
<div id="login">
<fieldset> <legend>Administração</legend>
<form ACTION="<?php echo $loginFormAction.?>" METHOD="POST" role="form" name="login"> <div class="form-group"> <label for="exampleInputEmail1">Email</label> <input name="email" type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"> </div> <div class="form-group"> <label for="exampleInputPassword1">Senha</label> <input name="senha" type="password" class="form-control" id="exampleInputPassword1" placeholder="Senha"> </div> <button type="submit" class="btn btn-default">Logar</button>
</form>
</fieldset>
</div> </body>
</html> Aguardo alguma sugestão de como resolver o problema, obrigado.Carregando comentários...