-3
I have the following table:
<tr id="teste">
<?php echo '<form id="teste" action="banco.php" method="post"><td><input id="bike'.$fetch['referenciageral'].'" name="bike'.$fetch['referenciageral'].'" onchange="this.form.submit()" type="checkbox" value="on" '.$fetch['checkbox'].' class="confirmacoes"><a href="banco.php"> </a></td></form>';?>
<?php echo '<td >'.utf8_encode($fetch['referenciageral']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['nivel']).'</td>'; ?>
<?php echo '<td>'.utf8_encode($fetch['numero_item']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['material']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['descricao']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['qtdeng']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['qtdfalt']).'</td>';?>
<?php echo '<td>'.utf8_encode($fetch['OBSERVACAO']).'</td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['PDF_PT'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_PDF_PT_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['PDF_IT'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_PDF_IT_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['LINK_JT'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_JT_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['LINK_DXF'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_DXF_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['LINK_RAR'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_RAR_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['LINK_ZIP'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_ZIP_IMAGE'].'" /></a></td>';?>
<?php echo '<td><a id="logo-container" href="'.$fetch['LINK_EPJ'].'" class="brand-logo"><img src="'.$fetch['LINK_TCD#LINK_EPJ_IMAGE'].'" /></a></td>';?>
<?php echo '<form id="teste2" action="preencheformulario.php" method="post"><td><input type="submit" id="dev'.$fetch['referenciageral'].'" name="dev'.$fetch['referenciageral'].'"
onclick="reply_click(this.id)" ></td></form>';?>
And I have the script:
<script type="text/javascript">
function reply_click(clicked_id)
{
alert(clicked_id);
<?php session_start(); $_SESSION['teste'] = this.id?>
}
</script>
I want the id
that appears in the alert
is stored in a PHP session.
I did as follows, but it does not work, the session is empty.
The phrase "cannot mix Javascript code with PHP" is ambiguous. Actually it is possible
let appName = "<?php echo "My App" ?>"
, what is not possible is to change the values of the variable PHP after processing.– Valdeir Psr
@Valdeirpsr is true, in the context of it, really is not possible, but has to explain better. I will edit
– Wallace Maxters