php - Edit button is undefined id of table -
i have code edit button:
<form method="post" action="pengiriman-input.php"> <input type="hidden" name="id" value="<?php echo $row['id_transaksi']; ?>" /> <input type="submit" value="kirim" /> </form>
and in pengiriman-input.php
<?php session_start(); $_session['id_transaksi'] = $_post['idtransaksi']; ?>
but result is:
undefined index: idtransaksi in > c:\xampp\htdocs\delivery\pengiriman-input.php
how call value of $row['idtransaksi']
pengiriman-input.php
?
$row['idtransaksi']
mysql query.
typo within post name
within name
attribute name='id'
, not idtransaksi
$_session['id_transaksi'] = $_post['idtransaksi']; ^^^^^^^^^^^
it should
$_session['id_transaksi'] = $_post['id']; ^^^
or can check either using isset function of php
$_session['id_transaksi'] = (isset($_post['id'])) ? $_post['id'] : 0;
Comments
Post a Comment