Ver Mensaje Individual
  #28 (permalink)  
Antiguo 14/06/2012, 03:23
Gothgauss
 
Fecha de Ingreso: marzo-2009
Mensajes: 395
Antigüedad: 15 años, 1 mes
Puntos: 11
Respuesta: Variables de sesion

El código de php queda así:
Código:
<?session_start();
$_SESSION['producto'][] = $_GET['producto'];
echo json_encode($_SESSION['producto']);

?>
y el script.php

Código:
<?session_start();?>
<head>
<script type="text/javascript" src="../js/jquery.js"></script>

<script>

$(document).ready(function(){
			$('#boton').click(function(){
	
			$.ajax({
				type:'GET',
				url:'sesion.php',
				data:{"producto":$('#texto').val()},
                                success: function(data){

                                        datos = data;

                                         datos = $.parseJSON(data);
						$.each(datos, function(i,j){		
                                                       $('#mostrardatos').text(value); 
							});
                                         }
											 
				});
				
			});
});





</script>
</head>
<body>

<input type="text" id="texto" /><input type="button" id="boton" value="dar" />

<span id="mostrardatos"></span>
</body>
pero no me da ningún resultado :(