mercredi 1 avril 2015

MVC PHP Sending row ID


Vote count:

0




I am creating a php mvc site, I am trying to add a delete button to each row, I have the button added but I am having trouble figuring out how to send the id back to the view from my form.


I think I have to use a foreach loop in my code but i dont know how to incorporate that with my form, I have tried the following but when I run this the browser prints out part of the code


Code



<?php
$result=$itemsDAO->getItems();
foreach ($result as $row) {
$uid = $row['id'];

<form action="index.php" method="post">
<fieldset>
<input id='action' type='hidden' name='action' value='deleteItem' />
<p>
<div class="form-group">
<div class="controls">
<input type="hidden" id="fUsername" name="uid" value=" ' .$uid. ' ">
<input type="submit" class="btn btn-success" value="Delete">
</div>
</div>
</p>
</fieldset>
</form>

}

?>


asked 2 mins ago







MVC PHP Sending row ID

Aucun commentaire:

Enregistrer un commentaire