Hi,.
I have problem with code ajax and jquery when from code ajax call one source
.php,
the session (create in these source .php) no exist when return...
can you help me?
thank“s
---------- source ajax ---------------
$(document).ready(function(){
$('#form1').ajaxForm({
dataType: 'json',
beforeSubmit: validar,
success: actualizar
});
});
function actualizar(data){
$('#contenido').html('');
$('#contenido').hide();
if (data.correcto == 'si'){
alert($_SESSION['nombre']);
$('#form1').fadeOut('slow', function(){
$('#contenido').html(data.mensaje).fadeIn('slow');
}); }
};
----------------
-------uno.php------------
if (session_id() == "") {
session_start();
$_SESSION['NOMBRE'] = 'gustavo';
echo '{ mensaje: "' .$_SESSION['nombre']. '", correcto:"si"}';
} else {
echo '{ mensaje: "' . $_POST['mensaje'] . '",
correcto:"si"}';
}
--------------