Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\xampp\htdocs\pruabaphp\zenkyu\TMP3s5r4u2w s6.php:7) in C:\xampp\xampp\htdocs\pruabaphp\zenkyu\zlogin.php on line 36
esta es la linea 36: de zlogin.php
que es la pagina en donde se registran para session
mor envio todo el codigo antes de !doctype
<?php require_once('../Connections/registro_usuarios.php'); ?>
<?php
if (isset($_POST['contrase'])) {$_POST['contrase'] = sha1($_POST['contrase']);}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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['nombreusuario'])) {
$loginUsername=$_POST['nombreusuario'];
$password=$_POST['contrase'];
$MM_fldUserAuthorization = "admin_priv";
$MM_redirectLoginSuccess = "zperfecto2.php";
$MM_redirectLoginFailed = "ztodo.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_registro_usuarios, $registro_usuarios);
$LoginRS__query=sprintf("SELECT nombreusuario, contrase, admin_priv FROM usuarios WHERE nombreusuario=%s AND contrase=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $registro_usuarios) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'admin_priv');
//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 );
}
}
?>
agradecido.