Foros del Web » Programando para Internet » PHP »

problemas en archivos fuentes.

Estas en el tema de problemas en archivos fuentes. en el foro de PHP en Foros del Web. Amigos tengo el siguiente problema, tengo un codigo que me lo dieron para cambiar unos reportes, pero resulta que hago solo un enter en los ...
  #1 (permalink)  
Antiguo 04/10/2010, 15:11
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Pregunta problemas en archivos fuentes.

Amigos tengo el siguiente problema, tengo un codigo que me lo dieron para cambiar unos reportes, pero resulta que hago solo un enter en los fuentes y el sistema deja de funcionar, y me muestra este mensaje

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at x:\xxxx\333\ggggg\gerencia.php:1) in x:\xxxxx\333\ggggg\gerencia.php on line 35

parece que es un tipo de seguridad que el programador que estaba aqui dejo insertado, la pregunta es como lo quito para seguir anadiendo opciones, ya que el programador dejo botado el proyecto.

Ayuda please!!!!
  #2 (permalink)  
Antiguo 04/10/2010, 15:15
 
Fecha de Ingreso: julio-2010
Ubicación: La Ciudad Blanca, Mérida-Yucatán
Mensajes: 375
Antigüedad: 13 años, 9 meses
Puntos: 7
Respuesta: problemas en archivos fuentes.

si pudieras mostra el archivo gerencia.php, se te podra ayudar mejor
__________________
--No todos aprendemos de la misma forma, ni a la misma velocidad---
  #3 (permalink)  
Antiguo 04/10/2010, 15:22
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: problemas en archivos fuentes.

aqui esta el codigo

<?php require_once('cnx.php'); ?>
<?php
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['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['clave'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "reportes.php";
$MM_redirectLoginFailed = "error.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_conn2, $conn2);

$LoginRS__query=sprintf("SELECT co_usua, cl_usua FROM tb_usuario WHERE co_usua=%s AND cl_usua=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

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

//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=utf-8" />
<META http-equiv="CACHE-CONTROL" content="NO-CACHE">
<META NAME="AUTHOR" CONTENT="Juan Camilo Vélez">
<title>Reservaciones Olimpo</title>
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="initial-scale=1.0" />
<meta name="viewport" content="user-scalable=false" />
<link href="styles/styles_v1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<img src="images/header.jpg" width="460" height="90" alt="Reservaciones Olimpo" />
<div id="content">
<div id="block">
<h2>Ingreso al Sistema</h2>
</div >
<div id="labels_login">Usuario:</div >
<div id="controls_login"><input type="text" name="user" id="user" /></div>
<div id="labels_login">Clave:</div >
<div id="controls_login"><input name="clave" type="password" id="clave"/>
</div>
<div id="labels_login"></div >
<div id="controls_login"> <input type="submit" class="boton" value="Enviar"/></div>

</div>
</form>
</div>
</body>
</html>
  #4 (permalink)  
Antiguo 04/10/2010, 15:56
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: problemas en archivos fuentes.

Verifica que tu editor este guardando los archivos en un formato UTF8 sin BOM.

Saludos.
  #5 (permalink)  
Antiguo 04/10/2010, 16:09
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: problemas en archivos fuentes.

Lo estoy haciendo con Notepad. por ahora.
  #6 (permalink)  
Antiguo 04/10/2010, 16:19
 
Fecha de Ingreso: enero-2009
Ubicación: Neiva, Huila
Mensajes: 196
Antigüedad: 15 años, 3 meses
Puntos: 2
Respuesta: problemas en archivos fuentes.

compadre, lo que pasa es que por defecto el notepad aveces lo guarda en formato ANSI...y este al interpretarlo el servidor te va a poner problemas....por que al no estar codificado en el formato UTF8, este te toma los saltos de lineas como salidas html y esto en los headers te va a poner problemas...y por estandar si vas a usar sessiones el session_start(), debe estar antes que cualquier linea....

esto se soluciona...con lo siguiente cuando vayas a guardar dile guardar como y cambia el tipo de codificacion del archivo y listo..
  #7 (permalink)  
Antiguo 04/10/2010, 16:23
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: problemas en archivos fuentes.

ok muchas gracias ya lo pongo en practica...
  #8 (permalink)  
Antiguo 04/10/2010, 16:26
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: problemas en archivos fuentes.

nop, ya lo hice segun lo sugerido y sigue dando problemasn, voy a ver si uso dreamweaver para ver si se soluciona ya aviso. Mil Gracias!!!
  #9 (permalink)  
Antiguo 04/10/2010, 16:44
 
Fecha de Ingreso: enero-2009
Ubicación: Neiva, Huila
Mensajes: 196
Antigüedad: 15 años, 3 meses
Puntos: 2
Respuesta: problemas en archivos fuentes.

compadre lo guardaste en UTF8....y si es bueno que uses otro editor...te recomiendo el notepad++ =)
  #10 (permalink)  
Antiguo 05/10/2010, 13:47
 
Fecha de Ingreso: septiembre-2009
Mensajes: 135
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: problemas en archivos fuentes.

Gracias problema resuelto.

Etiquetas: fuentes, seguridad
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:07.