Page 1 of 1

how to delete record one by one?

Posted: Thu Mar 06, 2003 2:39 am
by valen53
hi, all.
i got a problem now.
when i select all the record and display in the table, each record beside have a cancel button for delete a record. but the problem is i can't give value to that cancel button, so when click the button, system dunno delete which record.

anyone can help me ?
is OK if use checkbox , but i want use button

Posted: Thu Mar 06, 2003 5:25 am
by volka
try

Code: Select all

<html><body>
<pre><?php print_r($_POST); ?></pre>
<pre><?php print_r(array_flip($_POST)); ?></pre>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
	<table>
		<tr>
			<td>record #1</td>
			<td><input type="submit" name="1" value="delete" /></td>
		</tr>
		<tr>
			<td>record #2</td>
			<td><input type="submit" name="2" value="delete" /></td>
		</tr>
		<tr>
			<td>record #3</td>
			<td><input type="submit" name="3" value="delete" /></td>
		</tr>
	</table>
</form>
</html>