Hi to all stackoverflow users place the basic method directly in order to transmit data from one page to another via method = "POST" in PHP:
form.php:
<?php
session_start();
include '../connessione.php';
$id = $_SESSION['id'];
$query_string = "select * from ca2_2ac_clienti";
$query = mysqli_query($connessione, $query_string);
?>
<?php
while($row = mysqli_fetch_assoc($query)){ ?>
<form action="test.php" method="post">
<input name="text" value="<?php echo $row['id_cliente'] ;?>">
<input type="submit" name="invia">
</form>
<?php } ?>
test.php:
<?php $text = $_POST['text']; ?>
<form action="test.php" method="post">
<input name="text" value="<?php echo $text;?>">
<input type="submit" name="invia">
</form>
and up to here no problem, the problem arises when I want to implement this inside a table inside a while loop, ie inside my form in the value I do not see anything like it?
place the code:
<?php
while($row = mysqli_fetch_array($result))
{
?>
<!--Table body-->
<tbody>
<tr>
<th scope="row">
<label class="form-check-label" for="checkbox1" class="label-table"></label>
</th>
<form action="test.php" method="post">
<td style="vertical-align: middle;">
<input name="text" value="<?php echo $row['codice_impianto'] ;?>">
</td>
<a href="#modifica<?php echo $row['id_impianto']; ?>" data-toggle="modal" class="btn btn-sm btn-warning btn-rounded"><span class="glyphicon glyphicon-edit"></span> MODIFICA</a>
<a href="#elimina<?php echo $row['id_impianto']; ?>" data-toggle="modal" class="btn btn-sm btn-danger btn-rounded"><span class="glyphicon glyphicon-trash"></span> ELIMINA</a>
<input type="submit" name="invia">
</form>
<?php include('modali.php'); ?>
</td>
</tr>
</tbody>
<?php
}
}
else
{
echo 'Nessun risultato corrisponde alla tua ricerca';
}
?>