0
Hi, I wanted to get the input value "codigo_cat"
and play in the variable $id_categoria
that is at the bottom of the code PHP, to be able to run select using this variable as parameter.
By method GET And POST I could do, the problem is that I’m not submitting any form or button, for a method to be used.
Is there any way to do that? If anyone knows how to help me. I’ve been trying for 2 days! Thank you.
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="codigo">Código</label>
<input name="codigo" id="codigo_cat" type="text" class="form-control form-control-sm" placeholder="0" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php
$id_categoria = (QUERO O VALOR DO INPUT AQUI);
$query = "SELECT ativo AS ativo_status FROM categoria WHERE idCategoria = '$id_categoria'";
$result = mysqli_query($conexao, $query);
$row = mysqli_fetch_assoc($result);
if ($row['ativo_status'] == 'S') {
?>
<input type="checkbox" id="ativo" name="ativo" checked>
<?php
} else {
?>
<input type="checkbox" id="ativo" name="ativo">
<?php
}
?>
<label for="ativo">Ativo</label>
</div>
</div>
A doubt I was left, as you get the value of the field id=codigo_cat, it is reandonly must be filled by someone, it remains to know if it is by javascript or php
– Cleverson