Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/12/2010, 22:18
dmzg10
 
Fecha de Ingreso: noviembre-2009
Mensajes: 10
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: Variables supersuperglobales

¡Muchísimas gracias!

Según yo intenté usar las variables de sesión pero no me funcionan o no sé qué esté haciendo mal. He aquí mi código:

index.php
Código:
<?php
	session_start();
	$_SESSION['foo'] = 'HOLA';
?>
<html>
    <body>
		<?php 
            echo 'Variable de sesion '.$_SESSION['foo'];
        ?>
        <form action="hola.php" method="post" name="hola">
            <input type="text" name="inputX" />
        </form>
    </body>
</html>
hola.php
Código:
<?php 
	echo 'Variable de sesion '.$_SESSION['foo'];
?>
La salida de hola.php es:

Código:
Variable de sesion
Gracias!