Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/04/2013, 16:35
omar231120
 
Fecha de Ingreso: abril-2013
Ubicación: ss
Mensajes: 3
Antigüedad: 11 años, 7 meses
Puntos: 0
Busqueda session_start() [function.session-start]: Cannot send session cookie - headers alread

hola me gustaria solucionar mi problema

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/omar2311/public_html/index.php:11) in /home/omar2311/public_html/includes/acceso.php on line 37
alguien tiene alguna ayuda les dejo mi codigo para que vean


<?php require_once('Connections/swiki.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;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['id_email'])) {
$loginUsername=$_POST['id_email'];
$password=$_POST['id_contraseña'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "usuario.php";
$MM_redirectLoginFailed = "acceso_error.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_swiki, $swiki);

$LoginRS__query=sprintf("SELECT id_email, `id_contraseña` FROM tabla_usuario WHERE id_email=%s AND `id_contraseña`=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "-1"));

$LoginRS = mysql_query($LoginRS__query, $swiki) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

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 );
}
}
?>

<form id="acceso" name="form1" method="POST" action="<?php echo $loginFormAction;?>">
<p>Email:
<label for="id_email"></label>
<input type="text" name="id_email" id="id_email" />
</p>
<p>Contraseña:
<label for="id_contraseña"></label>
<input type="text" name="id_contraseña" id="id_contraseña" />
</p>
<p>
<input type="submit" name="button" id="button" value="Entrar" />
</p>
</form>