0
Follow the page link with the error: [ http://sistema.spessoa.com.br/ ]
I tried that method: [http://www.add-digital.com.br/blog/warning-session_start-function-session-start-cannot-send-session-cache-limiter-headers-already-sent/]
But it didn’t work!
Follows the code of index.php
<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('mysql.php'); ?>
<?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;
}
}
// *** Validate request to login to this site.
// session start old
$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 = "restrito.php";
$MM_redirectLoginFailed = "negado.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_mysql, $mysql);
$LoginRS__query=sprintf("SELECT EMAIL, SENHA FROM CAMPANHA2014 WHERE CODCLIPRINC=%s AND SENHA=%s",
GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "int"));
$LoginRS = mysql_query($LoginRS__query, $mysql) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'NIVEL');
$_SESSION["Email"] = $_POST['Email'];
$_SESSION["senha"] = $_POST['Senha'];
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 );
}
}
?>
<!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=iso-8859-1">
<title>:::::: Sou Parceiro, Sou Special ::::::</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="img/backcampanha.jpg" id="back" />
<div align="center">
<img src="img/logocampanha.png" id="logo1" />
<div/>
<div id="form_login">
<h1> Efetue seu Login</h1>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="frml_login">
<input name="Email" type="text" size="4" maxlength="100" placeholder="Código" ></br>
<input name="Senha" type="password" placeholder="Senha">
<input name="botao" style="margin-left:40px; margin-top:20px" type="submit" class="button" value="Login">
</form>
<p> <a href="http://www.spessoa.com.br"><img src="img/close.png" border="0" style=" float:right; margin:0 20px; padding:0" /></a></p>
</div>
<div align="center">
<img src="img/premios.png" id="logo2" />
<div/>
<div align="center">
<img src="img/logoscampanha.png" id="logo2" />
<div/>
</body>
</html>
Try changing the permissions of the folder
tmp
for writing. [EDIT 1] Enter the code correctly, not readable here.– Gabriel Carvalho