Get a value returned by AJAX generated in PHP

1

I have in pagina1.php a form that calls by AJAX to pagina2.php and I show what I got in div of pagina1.php

I also need to get the value of $_SESSION['io'] that I print in the pagina2.php .

$.ajax({ 
    type: "POST", 
    url: "div.php", 
    data: "tlf="+tlf, 
    success: function(consulta){
        $('#diva').html(consulta);
    } 
});

And the php2

$_SESSION['io'] = -1;

$query5 = oci_parse($conn,$consulta5);
oci_execute($query5);

while ($row5 = oci_fetch_array($query5, OCI_ASSOC + OCI_RETURN_NULLS)) {
    $_SESSION['io']++;
    echo "<tr>";
    echo "<td height='60px'><input type='date' name='mov_date".$_SESSION['io']."' value='".$row5['FECHA']."'></td><td><textarea name='mov_text".$_SESSION['io']."'>".$row5['MOVIMIENTO']."</textarea></td>";
    echo "</tr>";
}

echo "<tr><td>".$_SESSION['io']."</td></tr>";
echo "<input type='hidden' id='oculto' name='oculto' value='".$_SESSION['io']."'>";

?>

Plus all the connection to the BD and session_start(); .

And I want the variable $_SESSION['io'] on page1.php.

    
asked by Salva Serrano Del Rio 07.06.2017 в 12:31
source

0 answers