How to pass values from view to controller onclick... I need to save every row into the database
<table border="1" cellpadding="4" cellspacing="0">
<tr>
<td>from</td>
<td>to</td>
<td>title</td>
<td>openletter</td>
<td>open_id</td>
</tr>
<?php foreach ($r->result() as $row): ?>
<tr>
<td><?php echo $row->from; ?></td>
<td><?php echo $row->to; ?></td>
<td><?php echo $row->title; ?></td>
<td><?php echo $row->openletter; ?></td>
<td><?php echo $row->open_id; ?></td>
<td><input type="button" value="add to archieve" onclick="<?php echo $row->from; ?>" /></td>
<td><input type="button" value="add to new" onclick="" /></td>
<td><input type="button" value="Discard" onclick="" /></td>
</tr>
<?php endforeach; ?>
</table>
Use this
<td>
<input type="button" value="add to new" onclick="<?php echo base_url()?>index.php/controller/function" />
</td>
<td>
<input type="button" value="Discard" onclick="<?php echo base_url()?>index.php/controller/function" />
</td>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.