Foros del Web » Programando para Internet » PHP »

sistema para actualizar datos de usuario no detecta sesion

Estas en el tema de sistema para actualizar datos de usuario no detecta sesion en el foro de PHP en Foros del Web. amigos, espero esten bien. tengo un problema sencillo pero que no logro resolver. cree un form en dreamweaver para q el usuario actualice sus datos ...
  #1 (permalink)  
Antiguo 29/08/2007, 09:46
Avatar de leskolpykos  
Fecha de Ingreso: junio-2007
Ubicación: Caracas
Mensajes: 96
Antigüedad: 16 años, 9 meses
Puntos: 0
Pregunta sistema para actualizar datos de usuario no detecta sesion

amigos, espero esten bien. tengo un problema sencillo pero que no logro resolver.

cree un form en dreamweaver para q el usuario actualice sus datos una vez que inicie sesión, pero no importa quien inicie sesion, siempre aparecen los datos de un mismo usuario.

por ejemplo: registre dos usuarios: luis y pedro, no importa quien de los dos inicie sesión siempre aparecen los datos de luis o de pedro.

si luis inicio sesion deberian aparecer los de luis, y si pedro inicio sesion, deberian aparecer los de pedro, y no es asi. que será?

aca les coloco el codigo que genera dreamweaver a ver quien puede asesorarme donde está la falla

////////////////////////////////

<?php require_once('conexion.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE usuarios SET nombre=%s, cedula=%s, fecha=%s, edad=%s, direccion=%s, ciudad=%s, estado=%s, pais=%s, telf_hab=%s, telf_cel=%s, msn=%s, yahoo=%s, que_gusta=%s, que_gustaria=%s, comentarios=%s, web=%s, contrasena=%s, email=%s, newsletter=%s, eventos=%s WHERE nick=%s",
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['cedula'], "text"),
GetSQLValueString($_POST['fecha'], "text"),
GetSQLValueString($_POST['edad'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['ciudad'], "text"),
GetSQLValueString($_POST['estado'], "text"),
GetSQLValueString($_POST['pais'], "text"),
GetSQLValueString($_POST['telf_hab'], "text"),
GetSQLValueString($_POST['telf_cel'], "text"),
GetSQLValueString($_POST['msn'], "text"),
GetSQLValueString($_POST['yahoo'], "text"),
GetSQLValueString($_POST['que_gusta'], "text"),
GetSQLValueString($_POST['que_gustaria'], "text"),
GetSQLValueString($_POST['comentarios'], "text"),
GetSQLValueString($_POST['web'], "text"),
GetSQLValueString($_POST['contrasena'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['newsletter'], "text"),
GetSQLValueString($_POST['eventos'], "text"),
GetSQLValueString($_POST['nick'], "text"));

mysql_select_db($database_users);
$Result1 = mysql_query($updateSQL) or die(mysql_error());

$updateGoTo = "form_refresh_send_ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}

mysql_select_db($database_users);
$query_refresh = "SELECT * FROM usuarios";
$refresh = mysql_query($query_refresh) or die(mysql_error());
$row_refresh = mysql_fetch_assoc($refresh);
$totalRows_refresh = mysql_num_rows($refresh);
?>

/////////////////////////////

intenté colocarle esto que y tampoco

if (!isset($_SESSION)) {
session_start();
}

Última edición por leskolpykos; 29/08/2007 a las 09:48 Razón: faltaba algo
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 15:45.