Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/05/2007, 10:37
Avatar de rec321
rec321
 
Fecha de Ingreso: mayo-2005
Ubicación: Argentina
Mensajes: 91
Antigüedad: 19 años
Puntos: 1
Consulta sobre sesion

Estoy tratando de mantener el valor de una variable pero no doy con el tema.
He investigado y solo puedo hacer lo siguiente.
Quizas alguien pueda indicarme por que en index3.php no llega el valor
de la variable "xnombre"

Aqui va el ejemplo:

index.php
Código PHP:
<?php
session_start
(); 
session_register('xnombre'); 
$nombre=$_POST['nombre']; 
$xnombre=$_SESSION['xnombre']; 
$_SESSION['xnombre']=$nombre
?>
<html>
<body>
<form action="index2.php" method="post"> 
Dime el nombre <input type="text" name="nombre" size="20"><br> <input type="submit" value="ingresar"><br> 
</form>
</body> 
</html>
index2.php
Código PHP:
<html> 
<body>
<? 
echo 'Hola: '.$nombre.' <br>'
?>
<br>
<a href="index3.php">proximo link</a>
</body> 
</html>
index3.php (AQUI NO LLEGA EL VALOR DE "$nombre")
Código PHP:
<html> 
<body> 
<tt> 
<? 
      
echo 'hola: '.$nombre.' <br>'
?> 
</tt> 
</body> 
</html>

Que estoy haciendo mal?
Como puedo modificarlo?

Gracias
rec321